-GitHub | 🤖 ModelScope Studio | 🤗 Hugging Face Space
-
-`modelscope_studio`是一个基于 Gradio 的三方组件库,为开发者提供更定制化的界面搭建能力和更丰富的组件使用形式。
-
-目前支持的 UI 库:
-
-- [Ant Design](https://ant.design/)
-
-## 何时使用
-
-比起 Gradio 自身的组件,`modelscope_studio`更加注重页面布局和组件的灵活性,如果您想要构建更漂亮的用户界面,我们非常推荐您使用`modelscope_studio`。
-
-然而,当您的应用需要 Gradio 在 Python 端更多地处理内置数据时,`modelscope_studio`的组件可能不是最好的选择,但是不用担心,它可以很好地与已有的 Gradio 组件相结合,您仍然可以使用`modelscope_studio`来优化您的应用。
-
-## 依赖
-
-- Gradio >= 4.0
-
-## 安装
+## Install
```sh
pip install modelscope_studio
```
-## 示例
-
-
-
-## 迁移到 1.0
-
-如果您在之前使用了`modelscope_studio`的组件,并且想要在新版本中继续使用。不需要对原有组件做任何修改,只需要在外层引入`ms.Application`即可。
+## Components
-```python
-import gradio as gr
-import modelscope_studio.components.base as ms
-import modelscope_studio.components.legacy as mgr
-
-with gr.Blocks() as demo:
- with ms.Application():
- mgr.Chatbot()
-
-demo.launch()
-```
+- Chatbot
+- MultimodalInput
+- Markdown
diff --git a/README.md b/README.md
index e47a86123dc92a743a44cc1933d0f415ab62732a..4a8e19ea5a69f69c56f31ce6a0eb29aabc9f273f 100644
--- a/README.md
+++ b/README.md
@@ -1,71 +1,31 @@
---
tags:
- gradio-custom-component
- - component library
- - Ant Design
- - modelscope-studio
-title: modelscope-studio
-colorFrom: blue
-colorTo: gray
-short_description: A third-party component library based on Gradio.
-sdk: gradio
+ - Chatbot
+ - MutilmodalInput
+ - Markdown
+ - gradio-template-Chatbot
+ - gradio-template-Markdown
+title: modelscope_gradio_components V0.0.1b8
+colorFrom: red
+colorTo: red
+sdk: docker
pinned: false
-header: mini
-app_file: app.py
license: apache-2.0
---
# ModelScope Studio
-
-
-
- ✖️
-
-
-
+`modelscope_studio` is a set of extension component libraries based on gradio 4.x, dedicated to serving the various extension needs of gradio applications within the ModelScope Studio. It mainly focuses on enhancing conversational scenarios, supporting multimodal contexts, and providing assistance for various other specialized scenarios.
-
-GitHub | 🤖 ModelScope Studio | 🤗 Hugging Face Space
-
-`modelscope_studio` is a third-party component library based on Gradio, offers developers more customized interface building capabilities and a richer variety of component usage forms.
-
-Currently supported UI libraries:
-
-- [Ant Design](https://ant.design/)
-
-## When to Use
-
-Compared to the original components of Gradio, `modelscope_studio` focuses more on page layout and component flexibility. If you want to build a more beautiful user interface, we highly recommend using `modelscope_studio`.
-
-However, when your application needs Gradio to handle more built-in data on the Python side, the components of `modelscope_studio` may not be the best choice, but don't worry, it integrates well with existing Gradio components, you can still use `modelscope_studio` to optimize your application.
-
-## Dependencies
-
-- Gradio >= 4.0
-
-## Installation
+## Install
```sh
pip install modelscope_studio
```
-## Examples
-
-
-
-## Migration to 1.0
-
-If you have used the `modelscope_studio` component before and want to continue using it in the new version, you do not need to make any changes to the original component, just import `ms.Application` in the outer layer.
+## Components
-```python
-import gradio as gr
-import modelscope_studio.components.base as ms
-import modelscope_studio.components.legacy as mgr
-
-with gr.Blocks() as demo:
- with ms.Application():
- mgr.Chatbot()
-
-demo.launch()
-```
+- Chatbot
+- MultimodalInput
+- Markdown
diff --git a/api/app.py b/api/app.py
deleted file mode 100644
index 6f651d0bf3117ec127ca067c1c710df74910ddcf..0000000000000000000000000000000000000000
--- a/api/app.py
+++ /dev/null
@@ -1,19 +0,0 @@
-import os
-
-from components.legacy.Docs import Docs
-
-
-def resolve(relative_path: str):
- return os.path.join(os.path.dirname(__file__), relative_path)
-
-
-docs = Docs(
- __file__,
- markdown_files=([
- filename for filename in os.listdir(resolve('.'))
- if filename.endswith(".md")
- ]),
-)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/api/load-zh_CN.md b/api/load-zh_CN.md
deleted file mode 100644
index e2335833108056b7f1bdd61cf69b9dfe363abea1..0000000000000000000000000000000000000000
--- a/api/load-zh_CN.md
+++ /dev/null
@@ -1,30 +0,0 @@
-# load
-
-该特性与 [gr.load](https://www.gradio.app/docs/gradio/load) 类似。允许用户从已有创空间 [ModelScope Studio](https://modelscope.cn/studios) 仓库构造 demo。
-
-## 如何使用
-
-### 基本使用
-
-```python
-import modelscope_studio.components.legacy as mgr
-demo = mgr.load("modelscope/modelscope-studio")
-demo.launch()
-```
-
-### 使用访问令牌
-
-使用访问令牌来加载私有创空间。在这里找到您的 sdk 令牌:https://modelscope.cn/my/myaccesstoken。
-
-```python
-import modelscope_studio.components.legacy as mgr
-demo = mgr.load("modelscope/modelscope-studio", token="YOUR_ACCESS_TOKEN")
-demo.launch()
-```
-
-## 初始化
-
-| 属性 | 类型 | 默认值 | 描述 |
-| ----- | ---- | ------ | ---------------------------------------------------------------------------------------------------- |
-| name | str | None | 必填。 创空间名称(如: "modelscope/modelscope-studio")。 |
-| token | str | None | 用于加载私有创空间的可选访问令牌。 在这里找到您的 sdk 令牌:https://modelscope.cn/my/myaccesstoken。 |
diff --git a/api/load.md b/api/load.md
deleted file mode 100644
index 114baa1552200161830345a04e8c94c7c11ff1b3..0000000000000000000000000000000000000000
--- a/api/load.md
+++ /dev/null
@@ -1,30 +0,0 @@
-# load
-
-This feature is similar to [gr.load](https://www.gradio.app/docs/gradio/load). Allow users to Construct a demo from a [ModelScope Studio](https://modelscope.cn/studios) repo.
-
-## How to Use
-
-### Basic Usage
-
-```python
-import modelscope_studio.components.legacy as mgr
-demo = mgr.load("modelscope/modelscope-studio")
-demo.launch()
-```
-
-### With Access Token
-
-Use the access token to load a private ModelScope Studio repo. Find your sdk token here: https://modelscope.cn/my/myaccesstoken.
-
-```python
-import modelscope_studio.components.legacy as mgr
-demo = mgr.load("modelscope/modelscope-studio", token="YOUR_ACCESS_TOKEN")
-demo.launch()
-```
-
-## Initialization
-
-| Parameter | Type | Default Value | Description |
-| --------- | ---- | ------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
-| name | str | None | required. the name of the ModelScope Studio repo (e.g. "modelscope/modelscope-studio"). |
-| token | str | None | optional access token for loading private ModelScope Studio repo. Find your sdk token here: https://modelscope.cn/my/myaccesstoken. |
diff --git a/app.py b/app.py
index 112fb77ad76ce819727a914346c4a8ac1a441fe2..41659af68b2e1bca6472fbc7d8b25c8da1033d52 100644
--- a/app.py
+++ b/app.py
@@ -1,529 +1,22 @@
-import os
-from typing import Literal
-
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-from helper.Docs import Docs
-from helper.env import is_modelscope_studio
-from helper.Site import Site
-from legacy_app import legacy_demo
-
-
-def get_text(text: str, cn_text: str):
- if is_modelscope_studio:
- return cn_text
- return text
-
-
-def get_docs(type: Literal["antd", "antdx", "base"]):
- import importlib.util
-
- components = []
- components_dir = os.path.join(os.path.dirname(__file__), "components",
- type)
- for dir in os.listdir(components_dir):
- abs_dir = os.path.join(components_dir, dir)
- if os.path.isdir(abs_dir):
- app_file = os.path.join(abs_dir, "app.py")
- if os.path.exists(app_file):
- components.append(dir)
-
- docs = {}
- for component in components:
- spec = importlib.util.spec_from_file_location(
- "doc", os.path.join(components_dir, component, "app.py"))
- module = importlib.util.module_from_spec(spec)
- spec.loader.exec_module(module)
- docs[component] = module.docs
- return docs
-
-
-def get_layout_templates():
- import importlib.util
-
- templates = []
- templates_dir = os.path.join(os.path.dirname(__file__), "layout_templates")
- for dir in os.listdir(templates_dir):
- abs_dir = os.path.join(templates_dir, dir)
- if os.path.isdir(abs_dir):
- app_file = os.path.join(abs_dir, "app.py")
- if os.path.exists(app_file):
- templates.append(dir)
-
- docs = {}
- for template in templates:
- spec = importlib.util.spec_from_file_location(
- "doc", os.path.join(templates_dir, template, "app.py"))
- module = importlib.util.module_from_spec(spec)
- spec.loader.exec_module(module)
- docs[template] = module.docs
- return docs
-
-
-layout_templates = get_layout_templates()
-
-index_docs = {"overview": Docs(__file__), **layout_templates}
-
-base_docs = get_docs("base")
-antd_docs = get_docs("antd")
-antdx_docs = get_docs("antdx")
-
-default_active_tab = "index"
-index_menu_items = [{
- "label": get_text("ModelScope-Studio", "ModelScope-Studio"),
- "key": "overview"
-}, {
- "label":
- get_text("Layout Templates", "布局模板"),
- "type":
- "group",
- "children": [{
- "label": get_text("Coder-Artifacts", "Coder-Artifacts"),
- "key": "coder_artifacts"
- }]
-}]
-
-base_menu_items = [{
- "label":
- get_text("Core", "核心"),
- "type":
- "group",
- "children": [{
- "label": get_text("Application", "Application 应用"),
- "key": "application"
- }, {
- "label": get_text("AutoLoading", "AutoLoading 自动加载"),
- "key": "auto_loading"
- }, {
- "label": get_text("Slot", "Slot 插槽"),
- "key": "slot"
- }, {
- "label": get_text("Fragment", "Fragment 片段"),
- "key": "fragment"
- }]
-}, {
- "label":
- get_text("Layout", "布局"),
- "type":
- "group",
- "children": [{
- "label": "Div",
- "key": "div"
- }, {
- "label": "Span",
- "key": "span"
- }, {
- "label": "Text",
- "key": "text"
- }, {
- "label": "Markdown",
- "key": "markdown"
- }]
-}, {
- "label":
- get_text("Render", "渲染"),
- "type":
- "group",
- "children": [{
- "label": get_text("Each", "Each 循环"),
- "key": "each"
- }, {
- "label": get_text("Filter", "Filter 过滤"),
- "key": "filter"
- }]
-}]
-
-antd_menu_items = [{
- "label": get_text("Overview", "概览"),
- "key": "overview"
-}, {
- "label":
- get_text("General", "通用"),
- "type":
- "group",
- "children": [{
- "label": get_text("Button", "Button 按钮"),
- "key": "button"
- }, {
- "label": get_text("FloatButton", "FloatButton 悬浮按钮"),
- "key": "float_button"
- }, {
- "label": get_text("Icon", "Icon 图标"),
- "key": "icon"
- }, {
- "label": get_text("Typography", "Typography 排版"),
- "key": "typography"
- }]
-}, {
- "label":
- get_text("Layout", "布局"),
- "type":
- "group",
- "children": [{
- "label": get_text("Divider", "Divider 分割线"),
- "key": "divider"
- }, {
- "label": get_text("Flex", "Flex 弹性布局"),
- "key": "flex"
- }, {
- "label": get_text("Grid", "Grid 栅格"),
- "key": "grid"
- }, {
- "label": get_text("Layout", "Layout 布局"),
- "key": "layout"
- }, {
- "label": get_text("Space", "Space 间距"),
- "key": "space"
- }, {
- "label": get_text("Splitter", "Splitter 分割面板"),
- "key": "splitter"
- }]
-}, {
- "label":
- get_text("Navigation", "导航"),
- "type":
- "group",
- "children": [{
- "label": get_text("Anchor", "Anchor 锚点"),
- "key": "anchor"
- }, {
- "label": get_text("Breadcrumb", "Breadcrumb 面包屑"),
- "key": "breadcrumb"
- }, {
- "label": get_text("Dropdown", "Dropdown 下拉菜单"),
- "key": "dropdown"
- }, {
- "label": get_text("Menu", "Menu 导航菜单"),
- "key": "menu"
- }, {
- "label": get_text("Pagination", "Pagination 分页"),
- "key": "pagination"
- }, {
- "label": get_text("Steps", "Steps 步骤条"),
- "key": "steps"
- }]
-}, {
- "label":
- get_text("Data Entry", "数据录入"),
- "type":
- "group",
- "children": [{
- "label": get_text("AutoComplete", "AutoComplete 自动完成"),
- "key": "auto_complete"
- }, {
- "label": get_text("Cascader", "Cascader 级联选择"),
- "key": "cascader"
- }, {
- "label": get_text("Checkbox", "Checkbox 多选框"),
- "key": "checkbox"
- }, {
- "label": get_text("ColorPicker", "ColorPicker 颜色选择器"),
- "key": "color_picker"
- }, {
- "label": get_text("DatePicker", "DatePicker 日期选择框"),
- "key": "date_picker"
- }, {
- "label": get_text("Form", "Form 表单"),
- "key": "form"
- }, {
- "label": get_text("Input", "Input 输入框"),
- "key": "input"
- }, {
- "label": get_text("InputNumber", "InputNumber 数字输入框"),
- "key": "input_number"
- }, {
- "label": get_text("Mentions", "Mentions 提及"),
- "key": "mentions"
- }, {
- "label": get_text("Radio", "Radio 单选框"),
- "key": "radio"
- }, {
- "label": get_text("Rate", "Rate 评分"),
- "key": "rate"
- }, {
- "label": get_text("Select", "Select 选择器"),
- "key": "select"
- }, {
- "label": get_text("Slider", "Slider 滑动输入条"),
- "key": "slider"
- }, {
- "label": get_text("Switch", "Switch 开关"),
- "key": "switch"
- }, {
- "label": get_text("TimePicker", "TimePicker 时间选择器"),
- "key": "time_picker"
- }, {
- "label": get_text("Transfer", "Transfer 穿梭框"),
- "key": "transfer"
- }, {
- "label": get_text("TreeSelect", "TreeSelect 树选择"),
- "key": "tree_select"
- }, {
- "label": get_text("Upload", "Upload 上传"),
- "key": "upload"
- }]
-}, {
- "label":
- get_text("Data Display", "数据展示"),
- "type":
- "group",
- "children": [{
- "label": get_text("Avatar", "Avatar 头像"),
- "key": "avatar"
- }, {
- "label": get_text("Badge", "Badge 徽标数"),
- "key": "badge"
- }, {
- "label": get_text("Calendar", "Calendar 日历"),
- "key": "calendar"
- }, {
- "label": get_text("Card", "Card 卡片"),
- "key": "card"
- }, {
- "label": get_text("Carousel", "Carousel 走马灯"),
- "key": "carousel"
- }, {
- "label": get_text("Collapse", "Collapse 折叠面板"),
- "key": "collapse"
- }, {
- "label": get_text("Descriptions", "Descriptions 描述列表"),
- "key": "descriptions"
- }, {
- "label": get_text("Empty", "Empty 空状态"),
- "key": "empty"
- }, {
- "label": get_text("Image", "Image 图片"),
- "key": "image"
- }, {
- "label": get_text("List", "List 列表"),
- "key": "list"
- }, {
- "label": get_text("Popover", "Popover 气泡卡片"),
- "key": "popover"
- }, {
- "label": get_text("QRCode", "QRCode 二维码"),
- "key": "qr_code"
- }, {
- "label": get_text("Segmented", "Segmented 分段控制器"),
- "key": "segmented"
- }, {
- "label": get_text("Statistic", "Statistic 统计数值"),
- "key": "statistic"
- }, {
- "label": get_text("Table", "Table 表格"),
- "key": "table"
- }, {
- "label": get_text("Tabs", "Tabs 标签页"),
- "key": "tabs"
- }, {
- "label": get_text("Tag", "Tag 标签"),
- "key": "tag"
- }, {
- "label": get_text("Timeline", "Timeline 时间轴"),
- "key": "timeline"
- }, {
- "label": get_text("Tooltip", "Tooltip 文字提示"),
- "key": "tooltip"
- }, {
- "label": get_text("Tour", "Tour 漫游式引导"),
- "key": "tour"
- }, {
- "label": get_text("Tree", "Tree 树形控件"),
- "key": "tree"
- }]
-}, {
- "label":
- get_text("Feedback", "反馈"),
- "type":
- "group",
- "children": [{
- "label": get_text("Alert", "Alert 警告提示"),
- "key": "alert"
- }, {
- "label": get_text("Drawer", "Drawer 抽屉"),
- "key": "drawer"
- }, {
- "label": get_text("Message", "Message 全局提示"),
- "key": "message"
- }, {
- "label": get_text("Modal", "Modal 对话框"),
- "key": "modal"
- }, {
- "label": get_text("Notification", "Notification 通知提醒框"),
- "key": "notification"
- }, {
- "label": get_text("Popconfirm", "Popconfirm 气泡确认框"),
- "key": "popconfirm"
- }, {
- "label": get_text("Progress", "Progress 进度条"),
- "key": "progress"
- }, {
- "label": get_text("Result", "Result 结果"),
- "key": "result"
- }, {
- "label": get_text("Skeleton", "Skeleton 骨架屏"),
- "key": "skeleton"
- }, {
- "label": get_text("Spin", "Spin 加载中"),
- "key": "spin"
- }, {
- "label": get_text("Watermark", "Watermark 水印"),
- "key": "watermark"
- }]
-}, {
- "label":
- get_text("Other", "其他"),
- "type":
- "group",
- "children": [{
- "label": get_text("Affix", "Affix 固钉"),
- "key": "affix"
- }, {
- "label": get_text("ConfigProvider", "ConfigProvider 全局化配置"),
- "key": "config_provider"
- }]
-}]
-
-antdx_menu_items = [{
- "label": get_text("Overview", "概览"),
- "key": "overview"
-}, {
- "label":
- get_text("Common", "通用"),
- "type":
- "group",
- "children": [{
- "label": get_text("Bubble", "Bubble 对话气泡"),
- "key": "bubble"
- }, {
- "label": get_text("Conversations", "Conversations 管理对话"),
- "key": "conversations"
- }]
-}, {
- "label":
- get_text("Wake", "唤醒"),
- "type":
- "group",
- "children": [{
- "label": get_text("Welcome", "Welcome 欢迎"),
- "key": "welcome"
- }, {
- "label": get_text("Prompts", "Prompts 提示集"),
- "key": "prompts"
- }]
-}, {
- "label":
- get_text("Express", "表达"),
- "type":
- "group",
- "children": [{
- "label": get_text("Attachments", "Attachments 输入附件"),
- "key": "attachments"
- }, {
- "label": get_text("Sender", "Sender 输入框"),
- "key": "sender"
- }, {
- "label": get_text("Suggestion", "Suggestion 快捷指令"),
- "key": "suggestion"
- }]
-}, {
- "label":
- get_text("Confirm", "确认"),
- "type":
- "group",
- "children": [{
- "label": get_text("ThoughtChain", "ThoughtChain 思考链"),
- "key": "thought_chain"
- }]
-}, {
- "label":
- get_text("Tools", "工具"),
- "type":
- "group",
- "children": [{
- "label": get_text("XProvider", "XProvider 全局化配置"),
- "key": "x_provider"
- }]
-}]
-
-
-def logo():
- with antd.Flex(align='center', gap=8):
- antd.Image(os.path.join(os.path.dirname(__file__),
- "./resources/modelscope.png"),
- preview=False,
- height=20,
- elem_style=dict(width="auto"))
- ms.Span('✖️')
- antd.Image(os.path.join(os.path.dirname(__file__),
- "./resources/gradio.png"),
- preview=False,
- height=40,
- elem_style=dict(width="auto"))
-
-
-def more_components():
- with antd.Button(type="link",
- block=True,
- href="https://ant.design/components/overview/",
- href_target="_blank",
- elem_style=dict(display="block",
- textAlign="left",
- whiteSpace="nowrap",
- textOverflow="ellipsis",
- overflow="hidden")):
- ms.Text(get_text("More Components", "更多组件"))
-
- with ms.Slot("icon"):
- antd.Icon("ExportOutlined", elem_style=dict(marginRight=4))
-
-
-tabs = [
- {
- "label": get_text("Overview", "概览"),
- "key": "index",
- "default_active_key": "overview",
- "menus": index_menu_items
- },
- {
- "label": get_text("Base Components", "基础组件"),
- "key": "base",
- "default_active_key": "application",
- "menus": base_menu_items
- },
- {
- "label": get_text("Antd Components", "Antd 组件"),
- "key": "antd",
- "default_active_key": "overview",
- "menus": antd_menu_items,
- "extra_menu_footer": more_components
- },
- {
- "label": get_text("Antdx Components", "Antdx 组件"),
- "key": "antdx",
- "default_active_key": "overview",
- "menus": antdx_menu_items,
- },
- {
- "label": get_text("Version 0.x", "0.x 版本"),
- "key": "legacy",
- "content": legacy_demo
- },
+import gradio as gr
+from components.Chatbot.app import docs as chatbot_docs
+from components.Docs import Docs
+from components.Markdown.app import docs as markdown_docs
+from components.MultimodalInput.app import docs as multimodel_input_docs
+
+readme_docs = Docs(__file__)
+
+docs = [
+ ["Quick Start", readme_docs],
+ ["Chatbot", chatbot_docs],
+ ["Markdown", markdown_docs],
+ ["MultimodalInput", multimodel_input_docs],
]
-site = Site(
- tabs=tabs,
- docs={
- # match the key of tabs
- "index": index_docs,
- "antd": antd_docs,
- "antdx": antdx_docs,
- "base": base_docs
- },
- default_active_tab=default_active_tab,
- logo=logo)
-
-demo = site.render()
+with gr.Blocks() as demo:
+ with gr.Tabs() as components_tabs:
+ for doc in docs:
+ with gr.TabItem(doc[0], id=doc[0]):
+ doc[1].render(components_tabs)
-if __name__ == "__main__":
- demo.queue().launch(ssr_mode=False)
+demo.queue().launch()
diff --git a/components/legacy/Chatbot/README-zh_CN.md b/components/Chatbot/README-zh_CN.md
similarity index 52%
rename from components/legacy/Chatbot/README-zh_CN.md
rename to components/Chatbot/README-zh_CN.md
index 8b8398ae2c51586e4d5ae63c8d89ce3f073be2b4..6229af0559e80a5414ea789c69a3b05a9f3d9869 100644
--- a/components/legacy/Chatbot/README-zh_CN.md
+++ b/components/Chatbot/README-zh_CN.md
@@ -3,10 +3,9 @@
升级版的 gradio Chatbot。
- 支持前端匀速流式输出 message
-- 支持输出多模态内容(音频、视频、图片、文本)
-- 内置标签(chart、select-box、accordion)
+- 支持输出多模态内容(音频、视频、语音、文件、文本)
- 支持多 agent 场景
-- 支持自定义渲染组件,并与 Python 事件交互
+- 支持自定义渲染组件,并与 Python 侧事件交互
## 如何使用
@@ -29,8 +28,8 @@
同时为了适配大模型的工具调用链路,额外对某些大模型的格式做了预设配置,支持下述格式的预设处理(会将下面的格式转换成上方`accordion`标签包裹形式)
```python
-import modelscope_studio.components.legacy as mgr
-from modelscope_studio.components.legacy.Chatbot.llm_thinking_presets import qwen
+import modelscope_studio as mgr
+from modelscope_studio.components.Chatbot.llm_thinking_presets import qwen
# 添加 qwen 解析预设
mgr.Chatbot(llm_thinking_presets=[qwen()])
@@ -54,12 +53,6 @@ Observation: 「任意 md 内容,将作为完成调用的展示的下
-### 支持图表展示
-
-在返回的内容中加入 `chart` 标签,更多用法详见 Markdown 内置自定义标签
-
-
-
### 多 bot 场景
@@ -84,12 +77,6 @@ class FileMessage(GradioModel):
class MultimodalMessage(GradioModel):
- # 默认以 index 为作为 id,id 改变会导致 message 重新渲染
- id: Optional[str] = None
- # message 容器的 elem id
- elem_id: Optional[str] = None
- # message 容器的 elem classes
- elem_classes: Optional[List[str] | str] = None
name: Optional[str] = None
text: Optional[str] = None
flushing: Optional[bool] = None
@@ -109,21 +96,19 @@ class ChatbotData(GradioRootModel):
### props
-| 属性 | 类型 | 默认值 | 描述 |
-| ----------------------------- | -------------------------------------------------------------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| flushing | bool | True | 是否开启打字机效果。默认只有 bot 的 message 会开启,可以通过单独修改 message 的 flushing 属性精确控制每一条 message 的显示效果 |
-| enable_base64 | bool | False | 是否支持渲染的内容为 base64,因为直接渲染 base64 会带来安全问题,默认为 False。 |
-| enable_latex | bool | True | 是否支持 Latex 公式渲染 |
-| latex_single_dollar_delimiter | bool | True | 是否支持单`$`符号在 Latex 公式中渲染 |
-| preview | bool | True | 是否开启图片预览功能 |
-| avatar_images | tuple\[str \| Path \| None \| dict \| list, str \| Path \| None \| dict\| list\] | None | 拓展gr.Chatbot的参数值,除了接收 url 外还可以接收 dict 和 list,dict 可以传入avatar和name字段,name字段在渲染时会显示在头像下方。 - 当传入 dict 时,必须包含有avatar字段。 - 当传入 list 时,一般对应多 bot 模式,每一项可以接收前面所有的值,每个 bot 的头像与 message 中 bot 的位置一一对应 |
-| avatar_image_align | Literal['top', 'middle', 'bottom'] | 'bottom' | 控制头像与 message 的对齐方式,默认为下对齐 |
-| avatar_image_width | int | 45 | 头像与名称的宽度 |
-| flushing_speed | int | 3 | 打字机速度,值为 1 - 10,值越大速度越快 |
-| llm_thinking_presets | list\[dict\] | \[\] | llm 思考链路解析预设,可以将 llm 调用工具的输出格式转为固定的前端展示格式,需要从modelscope_studio.Chatbot.llm_thinking_presets引入,目前支持:qwen |
-| custom_components | dict\[str, CustomComponentDict\] CustomComponentDict 定义见下方 | None | 支持用户定义自定义标签,并通过 js 控制标签渲染样式与触发 python 事件。 |
-
-**CustomComponentDict 定义如下**
+| 属性 | 类型 | 默认值 | 描述 |
+| -------------------- | -------------------------------------------------------------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| flushing | bool | True | 是否开启打字机效果。默认只有 bot 的 message 会开启,可以通过单独修改 message 的 flushing 属性精确控制每一条 message 的显示效果 |
+| enable_base64 | bool | False | 是否支持渲染的内容为 base64,因为直接渲染 base64 有安全问题,默认为 False。 |
+| preview | bool | True | 是否开启图片预览功能 |
+| avatar_images | tuple\[str \| Path \| None \| dict \| list, str \| Path \| None \| dict\| list\] | None | 拓展gr.Chatbot的参数值,除了接收 url 外还可以接收 dict 和 list,dict 可以传入avatar和name字段,name字段在渲染时会显示在头像下方。 - 当传入 dict 时,必须包含有avatar字段。 - 当传入 list 时,一般对应多 bot 模式,每一项可以接收前面所有的值,每个 bot 的头像与 message 中 bot 的位置一一对应 |
+| avatar_image_align | Literal['top', 'middle', 'bottom'] | 'bottom' | 控制头像与 message 的对齐方式,默认为下对齐 |
+| avatar_image_width | int | 45 | 头像与名称的宽度 |
+| flushing_speed | int | 3 | 打字机速度,值为 1 - 10,值越大速度越快 |
+| llm_thinking_presets | list\[dict\] | \[\] | llm 思考链路解析预设,可以将 llm 调用工具的输出格式转为固定的前端展示格式,需要从modelscope_studio.Chatbot.llm_thinking_presets引入,目前支持:qwen |
+| custom_components | dict\[str, CustomComponentDict\] CustomComponentDict 定义见下方 | None | 支持用户定义自定义标签,并通过 js 控制标签渲染样式与触发 python 事件。 |
+
+**CustomComponent 定义如下**
```python
class CustomComponentDict(TypedDict):
@@ -138,7 +123,7 @@ class CustomComponentDict(TypedDict):
### event listeners
-| 事件 | 描述 |
-| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| `mgr.Chatbot.flushed(fn, ···)` | 当打字机效果结束时触发。EventData 为: - index:当前 message 的 index tuple。 - value:当前 message value。 |
-| `mgr.Chatbot.custom(fn, ···)` | 自定义标签触发事件时触发,EventData 为: - index:当前 message 的 index tuple ([message index, user group(index 0) or bot group(index 1), user/bot group index])。 - tag:当前触发的标签。 - tag_index:当前触发标签的 index,此 index 在 message 的 index tuple 基础上重新计算。 - value:自定义传入的值。 |
+| 事件 | 描述 |
+| ------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `mgr.Chatbot.flushed(fn, ···)` | 当打字机效果结束时触发。EventData 为: - index:当前 message 的 index tuple。 - value:当前 message value。 |
+| `mgr.Chatbot.custom(fn, ···)` | 自定义标签触发事件时触发,EventData 为: - index:前 message 的 index tuple。 - tag:当前触发的标签。 - tag_index:当前触发标签的 index,此 index 在 mesage 的 index tuple 基础上重新计算。 - value:自定义传入的值。 |
diff --git a/components/legacy/Chatbot/README.md b/components/Chatbot/README.md
similarity index 53%
rename from components/legacy/Chatbot/README.md
rename to components/Chatbot/README.md
index ef41002eb4652e35a6207600fe30b09a82c1d467..048c83e3f0f79604e02289f14986cf446a3e6c81 100644
--- a/components/legacy/Chatbot/README.md
+++ b/components/Chatbot/README.md
@@ -3,10 +3,9 @@
Upgraded gradio Chatbot.
- Supports uniform frontend streaming output of messages
-- Supports output of multimodal content (audio, video, image, text)
-- Built-in tags (chart, select-box, accordion)
+- Supports output of multimodal content (audio, video, voice, files, text)
- Supports multi-agent scenarios
-- Supports custom rendering components and interaction with Python events
+- Supports custom rendering components and interaction with events on the Python side
## How to Use
@@ -28,8 +27,8 @@ Include the `accordion` tag in the returned content to add an accordion within t
Additionally, to adapt to the toolchain usage of large models, some preset configurations for certain large models have been made. Support for the following preset formats (which will be converted into the form wrapped by the above `accordion` tag).
```python
-import modelscope_studio.components.legacy as mgr
-from modelscope_studio.components.legacy.Chatbot.llm_thinking_presets import qwen
+import modelscope_studio as mgr
+from modelscope_studio.components.Chatbot.llm_thinking_presets import qwen
# Add qwen preset
mgr.Chatbot(llm_thinking_presets=[qwen()])
@@ -49,16 +48,10 @@ Observation: 「Any md content will be displayed in the drop-down box wh
### Support for User Selection Interaction
-Include the `select-box` tag in the returned content. For more usage details, see Markdown Built-in Custom Tags .
+Include the `select-box` tag in the returned content for more usage details, see Markdown Built-in Custom Tags .
-### Support for Chart Display
-
-Include the `chart` tag in the returned content. For more usage details, see Markdown Built-in Custom Tags .
-
-
-
### Multi-bot Scenarios
@@ -83,12 +76,6 @@ class FileMessage(GradioModel):
class MultimodalMessage(GradioModel):
- # By default, message index is used as id. it will cause the message to be re-rendered when id changed.
- id: Optional[str] = None
- # elem id of message container
- elem_id: Optional[str] = None
- # elem classes of message container
- elem_classes: Optional[List[str] | str] = None
name: Optional[str] = None
text: Optional[str] = None
flushing: Optional[bool] = None
@@ -108,19 +95,17 @@ class ChatbotData(GradioRootModel):
### props
-| Attribute | Type | Default Value | Description |
-| ----------------------------- | -------------------------------------------------------------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
-| flushing | bool | True | Whether to enable the typewriter effect. By default, only the bot's messages will have this effect, but you can control the display effect of each message precisely by modifying the flushing attribute of a message individually. |
-| enable_base64 | bool | False | Whether to support rendering content as base64, since rendering base64 is unsafe, the default is False. |
-| enable_latex | bool | True | Whether to enable LaTeX rendering. |
-| latex_single_dollar_delimiter | bool | True | Whether to enable single dollar delimiter `$` for LaTeX rendering. |
-| preview | bool | True | Whether to enable image preview functionality. |
-| avatar_images | tuple\[str \| Path \| None \| dict \| list, str \| Path \| None \| dict\| list\] | None | An extended parameter value for gr.Chatbot, in addition to accepting a URL, it can also accept a dict and list. The dict can include the fields avatar and name, where the name field will be displayed under the avatar when rendered. - When passing a dict, it must include an avatar field. - When passing a list, it generally corresponds to the multi-bot mode, where each item can receive all the aforementioned values, and each bot’s avatar matches with the position of the bot in the messages. |
-| avatar_image_align | Literal['top', 'middle', 'bottom'] | 'bottom' | Controls the alignment of the avatar with the messages, default is bottom-aligned. |
-| avatar_image_width | int | 45 | The width of the avatar and name. |
-| flushing_speed | int | 3 | Typewriter speed, values range from 1 - 10, with larger values indicating faster speeds. |
-| llm_thinking_presets | list\[dict\] | \[\] | llm thinking link presets, which can convert the output format of llm calling tools into a fixed front-end display format. It needs to be imported from modelscope_studio.Chatbot.llm_thinking_presets, and currently supports: qwen. |
-| custom_components | dict\[str, CustomComponentDict\] CustomComponentDict is defined below | None | Allows users to define custom tags and control tag rendering styles and trigger Python events through JS. |
+| Attribute | Type | Default Value | Description |
+| -------------------- | -------------------------------------------------------------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| flushing | bool | True | Whether to enable the typewriter effect. By default, only the bot's messages will have this effect, but you can control the display effect of each message precisely by modifying the flushing attribute of a message individually. |
+| enable_base64 | bool | False | Whether to support rendering content as base64, since rendering base64 is not safe, the default is False. |
+| preview | bool | True | Whether to enable image preview functionality. |
+| avatar_images | tuple\[str \| Path \| None \| dict \| list, str \| Path \| None \| dict\| list\] | None | An extended parameter value for gr.Chatbot, in addition to accepting a URL, it can also accept a dict and list. The dict can include the fields avatar and name, where the name field will be displayed under the avatar when rendered. - When passing a dict, it must include an avatar field. - When passing a list, it generally corresponds to the multi-bot mode, where each item can receive all the aforementioned values, and each bot’s avatar matches with the position of the bot in the messages. |
+| avatar_image_align | Literal['top', 'middle', 'bottom'] | 'bottom' | Controls the alignment of the avatar with the messages, default is bottom-aligned. |
+| avatar_image_width | int | 45 | The width of the avatar and name. |
+| flushing_speed | int | 3 | Typewriter speed, values range from 1 - 10, with larger values indicating faster speeds. |
+| llm_thinking_presets | list\[dict\] | \[\] | llm thinking link presets, which can convert the output format of llm calling tools into a fixed front-end display format. It needs to be imported from modelscope_studio.Chatbot.llm_thinking_presets, and currently supports: qwen. |
+| custom_components | dict\[str, CustomComponentDict\] CustomComponentDict is defined below | None | Allows users to define custom tags and control tag rendering styles and trigger Python events through JS. |
**Definition of CustomComponent is as follows:**
@@ -137,7 +122,7 @@ See Markdown Built-in Custom Tags
### event listeners
-| Event | Description |
-| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| `mgr.Chatbot.flushed(fn, ···)` | Triggered when the typewriter effect ends. EventData is: - index: The index tuple of the current message. - value: The current message value. |
-| `mgr.Chatbot.custom(fn, ···)` | Triggered when a custom tag event occurs. EventData is: - index: The index tuple of the current message ([message index, user group(index 0) or bot group(index 1), user/bot group index]). - tag: The current tag that triggered the event. - tag_index: The index of the current triggered tag, re-calculated based on the message’s index tuple. - value: The custom value passed in. |
+| Event | Description |
+| ------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `mgr.Chatbot.flushed(fn, ···)` | Triggered when the typewriter effect ends. EventData is: - index: The index tuple of the current message. - value: The current message value. |
+| `mgr.Chatbot.custom(fn, ···)` | Triggered when a custom tag event occurs. EventData is: - index: The index tuple of the previous message. - tag: The current tag that triggered the event. - tag_index: The index of the current triggered tag, re-calculated based on the index tuple of the message. - value: The custom value passed in. |
diff --git a/components/antd/anchor/app.py b/components/Chatbot/app.py
similarity index 72%
rename from components/antd/anchor/app.py
rename to components/Chatbot/app.py
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..77372ef291165f2cf77a8944f3f8b18773972190 100644
--- a/components/antd/anchor/app.py
+++ b/components/Chatbot/app.py
@@ -1,4 +1,4 @@
-from helper.Docs import Docs
+from components.Docs import Docs
docs = Docs(__file__)
diff --git a/components/Chatbot/demos/.DS_Store b/components/Chatbot/demos/.DS_Store
new file mode 100644
index 0000000000000000000000000000000000000000..5008ddfcf53c02e82d7eee2e57c38e5672ef89f6
Binary files /dev/null and b/components/Chatbot/demos/.DS_Store differ
diff --git a/components/legacy/Chatbot/demos/accordion.py b/components/Chatbot/demos/accordion.py
similarity index 79%
rename from components/legacy/Chatbot/demos/accordion.py
rename to components/Chatbot/demos/accordion.py
index 2c00ebfcbd4376593dc881f7f54572c6e2c453b8..ec571ecc489ac6adf0e702cf452faf969de463cd 100644
--- a/components/legacy/Chatbot/demos/accordion.py
+++ b/components/Chatbot/demos/accordion.py
@@ -1,14 +1,12 @@
import os
import gradio as gr
-import modelscope_studio.components.base as ms
-import modelscope_studio.components.legacy as mgr
-from modelscope_studio.components.legacy.Chatbot.llm_thinking_presets import \
- qwen
+import modelscope_studio as mgr
+from modelscope_studio.components.Chatbot.llm_thinking_presets import qwen
def resolve_assets(relative_path):
- return os.path.join(os.path.dirname(__file__), "../../resources",
+ return os.path.join(os.path.dirname(__file__), "../resources",
relative_path)
@@ -17,13 +15,11 @@ conversation = [
None, {
"text": f"""
Use accordion tag:
-
```json
{{"text": "glorious weather", "resolution": "1024*1024"}}
```
-
Qwen preset:
@@ -40,7 +36,7 @@ Observation: 「Any md content will be displayed in the drop-down box wh
],
]
-with gr.Blocks() as demo, ms.Application():
+with gr.Blocks() as demo:
mgr.Chatbot(
value=conversation,
llm_thinking_presets=[qwen()],
diff --git a/components/legacy/Chatbot/demos/basic.py b/components/Chatbot/demos/basic.py
similarity index 62%
rename from components/legacy/Chatbot/demos/basic.py
rename to components/Chatbot/demos/basic.py
index 13570f9a6ce0058575567994aff36915d71ec4fa..090485af8d05eaad3835514ba930b19f89f1c82c 100644
--- a/components/legacy/Chatbot/demos/basic.py
+++ b/components/Chatbot/demos/basic.py
@@ -2,8 +2,7 @@ import os
import time
import gradio as gr
-import modelscope_studio.components.base as ms
-import modelscope_studio.components.legacy as mgr
+import modelscope_studio as mgr
conversation = [
[
@@ -31,18 +30,18 @@ def flushed():
return gr.update(interactive=True)
-with gr.Blocks() as demo, ms.Application():
+with gr.Blocks() as demo:
chatbot = mgr.Chatbot(
value=conversation,
avatar_images=[
- os.path.join(os.path.dirname(__file__),
- "../../resources/user.jpeg"), {
- "name":
- "bot",
- "avatar":
- os.path.join(os.path.dirname(__file__),
- "../../resources/bot.jpeg")
- }
+ os.path.join(os.path.dirname(__file__), "../resources/user.jpeg"),
+ {
+ "name":
+ "bot",
+ "avatar":
+ os.path.join(os.path.dirname(__file__),
+ "../resources/bot.jpeg")
+ }
],
height=600,
)
diff --git a/components/legacy/Chatbot/demos/message_config.py b/components/Chatbot/demos/message_config.py
similarity index 84%
rename from components/legacy/Chatbot/demos/message_config.py
rename to components/Chatbot/demos/message_config.py
index cddb958ec420fadb31670906d48c38413096def2..12566f3c5500b67f4c9efacaa29e817af1f8db91 100644
--- a/components/legacy/Chatbot/demos/message_config.py
+++ b/components/Chatbot/demos/message_config.py
@@ -1,8 +1,7 @@
import time
import gradio as gr
-import modelscope_studio.components.base as ms
-import modelscope_studio.components.legacy as mgr
+import modelscope_studio as mgr
def submit(_chatbot):
@@ -26,7 +25,7 @@ def submit(_chatbot):
yield _chatbot
-with gr.Blocks() as demo, ms.Application():
+with gr.Blocks() as demo:
chatbot = mgr.Chatbot(height=600, )
button = gr.Button("Submit")
button.click(fn=submit, inputs=[chatbot], outputs=[chatbot])
diff --git a/components/legacy/Chatbot/demos/multi_bots.py b/components/Chatbot/demos/multi_bots.py
similarity index 89%
rename from components/legacy/Chatbot/demos/multi_bots.py
rename to components/Chatbot/demos/multi_bots.py
index 21795b02978988ff8c57acadb969ce6be1a22c28..13f6642ec1b9155443566235b727bf56689f47af 100644
--- a/components/legacy/Chatbot/demos/multi_bots.py
+++ b/components/Chatbot/demos/multi_bots.py
@@ -2,12 +2,11 @@ import os
import time
import gradio as gr
-import modelscope_studio.components.base as ms
-import modelscope_studio.components.legacy as mgr
+import modelscope_studio as mgr
def resolve_assets(relative_path):
- return os.path.join(os.path.dirname(__file__), "../../resources",
+ return os.path.join(os.path.dirname(__file__), "../resources",
relative_path)
@@ -58,7 +57,7 @@ def flushed():
return gr.update(interactive=True)
-with gr.Blocks() as demo, ms.Application():
+with gr.Blocks() as demo:
chatbot = mgr.Chatbot(
value=conversation,
avatar_image_width=40,
diff --git a/components/legacy/Chatbot/demos/multimodal.py b/components/Chatbot/demos/multimodal.py
similarity index 70%
rename from components/legacy/Chatbot/demos/multimodal.py
rename to components/Chatbot/demos/multimodal.py
index cbb2fae83535c20290792f873cc8ba01fda66b54..066cd7d8941f38070daccc472fc72ddfd3387577 100644
--- a/components/legacy/Chatbot/demos/multimodal.py
+++ b/components/Chatbot/demos/multimodal.py
@@ -1,12 +1,11 @@
import os
import gradio as gr
-import modelscope_studio.components.base as ms
-import modelscope_studio.components.legacy as mgr
+import modelscope_studio as mgr
def resolve_assets(relative_path):
- return os.path.join(os.path.dirname(__file__), "../../resources",
+ return os.path.join(os.path.dirname(__file__), "../resources",
relative_path)
@@ -20,6 +19,10 @@ Image
+Video
+
+
+
Audio
@@ -29,7 +32,7 @@ Audio
],
]
-with gr.Blocks() as demo, ms.Application():
+with gr.Blocks() as demo:
mgr.Chatbot(
value=conversation,
height=600,
diff --git a/components/legacy/Chatbot/demos/select-box.py b/components/Chatbot/demos/select-box.py
similarity index 79%
rename from components/legacy/Chatbot/demos/select-box.py
rename to components/Chatbot/demos/select-box.py
index cfbae22e363944831f537c9d7ab63f610efc69f1..97b73cf91b5173c53c5211f0cf61fba49d56de37 100644
--- a/components/legacy/Chatbot/demos/select-box.py
+++ b/components/Chatbot/demos/select-box.py
@@ -1,8 +1,7 @@
import json
import gradio as gr
-import modelscope_studio.components.base as ms
-import modelscope_studio.components.legacy as mgr
+import modelscope_studio as mgr
# `label` will display on the page, and `value` is the actual selected value.
options = [{"label": "A", "value": "a"}, "b", "c"]
@@ -11,9 +10,9 @@ conversation = [[
None, f"""
Single Select:
-Multiple Select:
+Multiple Select:
-Vertical Direction:
+Vertical Direction:
@@ -35,7 +34,7 @@ def fn(data: gr.EventData):
print(data._data)
-with gr.Blocks() as demo, ms.Application():
+with gr.Blocks() as demo:
chatbot = mgr.Chatbot(
value=conversation,
flushing=False,
diff --git a/components/legacy/resources/audio.wav b/components/Chatbot/resources/audio.wav
similarity index 100%
rename from components/legacy/resources/audio.wav
rename to components/Chatbot/resources/audio.wav
diff --git a/components/legacy/resources/bot.jpeg b/components/Chatbot/resources/bot.jpeg
similarity index 100%
rename from components/legacy/resources/bot.jpeg
rename to components/Chatbot/resources/bot.jpeg
diff --git a/components/Chatbot/resources/custom_components/custom_select.js b/components/Chatbot/resources/custom_components/custom_select.js
new file mode 100644
index 0000000000000000000000000000000000000000..ca7e2ae712ca53eff775d1f5b22d9c004720db0b
--- /dev/null
+++ b/components/Chatbot/resources/custom_components/custom_select.js
@@ -0,0 +1,26 @@
+(props, cc, { el, onMount }) => {
+ const options = JSON.parse(props.options);
+ el.innerHTML = `
+ ${options
+ .map((option) => {
+ return `
+
+
`;
+ })
+ .join('')}
+ `;
+ onMount(() => {
+ const inputs = Array.from(el.getElementsByTagName('input'));
+ Array.from(el.getElementsByTagName('label')).forEach((label, i) => {
+ label.addEventListener('click', () => {
+ inputs.forEach((input) => {
+ input.checked = false;
+ });
+ const input = label.getElementsByTagName('input')[0];
+ input.checked = true;
+ // Use cc.dispatch to trigger events.
+ cc.dispatch(options[i]);
+ });
+ });
+ });
+};
diff --git a/components/Chatbot/resources/dog.mp4 b/components/Chatbot/resources/dog.mp4
new file mode 100644
index 0000000000000000000000000000000000000000..062b9c81317de43f392c56e9e03444bf8cc31d51
--- /dev/null
+++ b/components/Chatbot/resources/dog.mp4
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:39d086ce29e48cf76e5042d2f3f0611ee46575f70fa3dc0c40dd4cfffde3d933
+size 8626383
diff --git a/components/legacy/resources/image-bot.jpeg b/components/Chatbot/resources/image-bot.jpeg
similarity index 100%
rename from components/legacy/resources/image-bot.jpeg
rename to components/Chatbot/resources/image-bot.jpeg
diff --git a/components/legacy/resources/music-bot.jpeg b/components/Chatbot/resources/music-bot.jpeg
similarity index 100%
rename from components/legacy/resources/music-bot.jpeg
rename to components/Chatbot/resources/music-bot.jpeg
diff --git a/components/legacy/resources/screen.jpeg b/components/Chatbot/resources/screen.jpeg
similarity index 100%
rename from components/legacy/resources/screen.jpeg
rename to components/Chatbot/resources/screen.jpeg
diff --git a/components/legacy/resources/user.jpeg b/components/Chatbot/resources/user.jpeg
similarity index 100%
rename from components/legacy/resources/user.jpeg
rename to components/Chatbot/resources/user.jpeg
diff --git a/components/legacy/Docs.py b/components/Docs.py
similarity index 79%
rename from components/legacy/Docs.py
rename to components/Docs.py
index 6c1eb421dd657e16c1484aa36441e419e2509e91..b0932b912662ccf20ce17632fdb37a36d22bd00d 100644
--- a/components/legacy/Docs.py
+++ b/components/Docs.py
@@ -3,8 +3,7 @@ import re
from typing import Callable
import gradio as gr
-import modelscope_studio.components.legacy as mgr
-from helper.env import is_modelscope_studio
+import modelscope_studio as mgr
from .parse_markdown import parse_markdown
@@ -49,7 +48,7 @@ def get_demo_modules(file_path: str):
demos = [
demo for demo in list_demos(
os.path.join(os.path.dirname(file_path), "demos"))
- if demo.endswith(".py") and not demo.startswith("__")
+ if demo.endswith(".py")
]
demo_modules = {}
for demo in demos:
@@ -62,6 +61,9 @@ def get_demo_modules(file_path: str):
return demo_modules
+is_modelscope_studio = os.getenv('MODELSCOPE_ENVIRONMENT') == 'studio'
+
+
class Docs:
def __init__(self, file_path: str, markdown_files: list = None):
@@ -90,41 +92,23 @@ class Docs:
"r") as f:
return f.read()
- def render_demo(self,
- demo_name,
- code_position='left',
- prefix='',
- suffix=''):
+ def render_demo(self, demo_name, prefix='', suffix=''):
content = self.read_file(f"./demos/{demo_name}.py")
module = self.demo_modules[demo_name]
with gr.Accordion("Show Demo", open=False):
-
- def render_code():
- mgr.Markdown(f"""{prefix}
+ with gr.Row():
+ with gr.Column():
+ mgr.Markdown(f"""
+{prefix}
````python
{content}
````
-{suffix}""",
- header_links=True,
- custom_components=custom_components)
-
- if code_position == 'top':
- with gr.Row():
- with gr.Column():
- render_code()
- with gr.Row():
- if code_position == 'left':
- with gr.Column():
- render_code()
+{suffix}
+""",
+ header_links=True,
+ custom_components=custom_components)
with gr.Column():
module.demo.render()
- if code_position == 'right':
- with gr.Column():
- render_code()
- if code_position == 'bottom':
- with gr.Row():
- with gr.Column():
- render_code()
def render_markdown(self,
markdown_file,
@@ -136,21 +120,19 @@ class Docs:
if item["type"] == "text":
md = mgr.Markdown(item["value"],
header_links=True,
- custom_components=custom_components,
- preview=False)
+ custom_components=custom_components)
deps = [dep for dep in [components_tabs, self.tabs] if dep]
if len(deps) > 0:
md.custom(fn=on_tab_link_click, outputs=deps)
elif item["type"] == "demo":
self.render_demo(item["name"],
prefix=item["prefix"],
- suffix=item["suffix"],
- code_position=item["code_position"])
+ suffix=item["suffix"])
def render(self, components_tabs=None):
def tab_link_click(data: gr.EventData):
- tab: str = data._data.get("value", {}).get("tab", '')
+ tab: str = data._data["value"].get("tab", '')
component_tab: str = data._data["value"].get("component_tab", '')
if tab and tabs:
return {tabs: gr.update(selected=tab)}
diff --git a/components/legacy/Markdown/README-zh_CN.md b/components/Markdown/README-zh_CN.md
similarity index 50%
rename from components/legacy/Markdown/README-zh_CN.md
rename to components/Markdown/README-zh_CN.md
index 00b406acdd547c21cad85e58e07f416a34ca9e06..e95ff7fa6b18e2a0c1005ef4f32a93642ada89c4 100644
--- a/components/legacy/Markdown/README-zh_CN.md
+++ b/components/Markdown/README-zh_CN.md
@@ -2,9 +2,8 @@
升级版的 gradio Markdown。
-- 支持输出多模态内容(音频、视频、图片、文本)
-- 内置标签(chart、select-box、accordion)
-- 支持自定义渲染组件,并与 Python 事件交互
+- 支持输出多模态内容(音频、视频、语音、文件、文本)
+- 支持自定义渲染组件,并与 Python 侧事件交互
## 如何使用
@@ -28,12 +27,6 @@
-### 支持图表展示
-
-在返回的内容中加入 `chart` 标签,更多用法详见 chart
-
-
-
### 自定义标签(高阶用法,需要了解前端知识)
@@ -49,13 +42,13 @@ template只能做简单的变量替换,如果想要引入更多自定义的行
custom_select.js
```js
-
+
```
-#### 与 Python 交互
+#### 与 Python 侧交互
在 js 中可以使用`cc.dispatch`触发 Python 侧监听的`custom`事件,以前面的custom_select.js为例,我们在前端调用了`cc.dispatch(options[i])`,则会向 Python 侧同时发送通知。
@@ -67,15 +60,13 @@ custom_select.js
### props
-| 属性 | 类型 | 默认值 | 描述 |
-| ----------------------------- | --------------------------------------------------------------- | ------ | --------------------------------------------------------------------------- |
-| enable_base64 | bool | False | 是否支持渲染的内容为 base64,因为直接渲染 base64 有安全问题,默认为 False。 |
-| enable_latex | bool | True | 是否支持 Latex 公式渲染 |
-| latex_single_dollar_delimiter | bool | True | 是否支持单`$`符号在 Latex 公式中渲染 |
-| preview | bool | True | 是否开启图片预览功能 |
-| custom_components | dict\[str, CustomComponentDict\] CustomComponentDict 定义见下方 | None | 支持用户定义自定义标签,并通过 js 控制标签渲染样式与触发 python 事件。 |
+| 属性 | 类型 | 默认值 | 描述 |
+| ----------------- | --------------------------------------------------------------- | ------ | --------------------------------------------------------------------------- |
+| enable_base64 | bool | False | 是否支持渲染的内容为 base64,因为直接渲染 base64 有安全问题,默认为 False。 |
+| preview | bool | True | 是否开启图片预览功能 |
+| custom_components | dict\[str, CustomComponentDict\] CustomComponentDict 定义见下方 | None | 支持用户定义自定义标签,并通过 js 控制标签渲染样式与触发 python 事件。 |
-**CustomComponentDict 定义如下**
+**CustomComponent 定义如下**
```python
class CustomComponentDict(TypedDict):
@@ -88,10 +79,9 @@ class CustomComponentDict(TypedDict):
- select-box
- accordion
-- chart
### event listeners
-| 事件 | 描述 |
-| ------------------------------ | ---------------------------------------------------------------------------------------------------------------- |
-| `mgr.Markdown.custom(fn, ···)` | 自定义标签触发事件时触发,EventData 为: - tag_index:当前触发标签的 index。 - value:自定义传入的值。 |
+| 事件 | 描述 |
+| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| `mgr.Markdown.custom(fn, ···)` | 自定义标签触发事件时触发,EventData 为: - index:当前 message 的 index tuple ([message index, user group(index 0) or bot group(index 1), user/bot group index])。 - tag:当前触发的标签。 - tag_index:当前触发标签的 index,此 index 在 mesage 的 index tuple 基础上重新计算。 - value:自定义传入的值。 |
diff --git a/components/Markdown/README.md b/components/Markdown/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..14f01cc05a494b9a1f0dcd52cc5ba9cf4bfb6e05
--- /dev/null
+++ b/components/Markdown/README.md
@@ -0,0 +1,83 @@
+# Markdown
+
+Upgraded gradio Markdown.
+
+- Supports output of multimodal content (audio, video, voice, files, text)
+- Supports custom rendering components and interaction with Python-side events
+
+## How to Use
+
+### Basic Usage
+
+
+
+### Multimodal & Support for Local File Display
+
+
+
+### Support for Accordion Content Display
+
+Include the `accordion` tag in the returned content for more usage details, see accordion
+
+
+### Support for User Selection Interaction
+
+Include the `select-box` tag in the returned content for more usage details, see select-box
+
+
+### Custom Tags (Advanced Usage, Requires Frontend Knowledge)
+
+
+
+#### Importing js
+
+
+The template can only perform simple variable replacements. If you want to introduce more custom behaviors, such as conditional judgments, loop rendering, etc., please use js to control the element for processing. Here is a simple example:
+
+
+custom_select.js
+
+```js
+
+```
+
+
+
+
+#### Interaction with Python Side
+
+In js, you can use `cc.dispatch` to trigger the `custom` event listened to on the Python side. Taking the previous custom_select.js as an example, when we call `cc.dispatch(options[i])` on the frontend, a notification will be sent to the Python side simultaneously.
+
+
+## API and Parameter List
+
+The following APIs are additional extended parameters beyond the original gradio Markdown.
+
+### props
+
+| Attribute | Type | Default Value | Description |
+| ----------------- | ------------------------------------------------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------- |
+| enable_base64 | bool | False | Whether to support rendering content as base64, since rendering base64 directly can pose security issues, the default is False. |
+| preview | bool | True | Whether to enable image preview functionality. |
+| custom_components | dict[str, CustomComponentDict] CustomComponentDict definition below | None | Supports user-defined custom tags and controls tag rendering styles and triggers Python events through js. |
+| |
+
+**CustomComponent definition is as follows:**
+
+```python
+class CustomComponentDict(TypedDict):
+ props: Optional[List[str]]
+ template: Optional[str]
+ js: Optional[str]
+```
+
+### Built-in Custom Tags
+
+- select-box
+- accordion
+
+### Event Listeners
+
+| Event | Description |
+| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `mgr.Markdown.custom(fn, ···)` | Triggered when a custom tag event occurs. EventData is: - index: The index tuple of the current message ([message index, user group(index 0) or bot group(index 1), user/bot group index]). - tag: The current tag that triggered the event. - tag_index: The index of the current triggered tag, re-calculated based on the message’s index tuple. - value: The custom value passed in. |
diff --git a/components/legacy/Markdown/app.py b/components/Markdown/app.py
similarity index 90%
rename from components/legacy/Markdown/app.py
rename to components/Markdown/app.py
index 7b991a9dd6cdf70f2cf2bb84766850a0f2c3cd21..4e59b2548c878772ff9c32e0308b393caf24ed2e 100644
--- a/components/legacy/Markdown/app.py
+++ b/components/Markdown/app.py
@@ -1,6 +1,6 @@
import os
-from components.legacy.Docs import Docs
+from components.Docs import Docs
def resolve(relative_path: str):
diff --git a/components/legacy/Markdown/custom_tags/accordion-zh_CN.md b/components/Markdown/custom_tags/accordion-zh_CN.md
similarity index 100%
rename from components/legacy/Markdown/custom_tags/accordion-zh_CN.md
rename to components/Markdown/custom_tags/accordion-zh_CN.md
diff --git a/components/legacy/Markdown/custom_tags/accordion.md b/components/Markdown/custom_tags/accordion.md
similarity index 100%
rename from components/legacy/Markdown/custom_tags/accordion.md
rename to components/Markdown/custom_tags/accordion.md
diff --git a/components/legacy/Markdown/custom_tags/select-box-zh_CN.md b/components/Markdown/custom_tags/select-box-zh_CN.md
similarity index 100%
rename from components/legacy/Markdown/custom_tags/select-box-zh_CN.md
rename to components/Markdown/custom_tags/select-box-zh_CN.md
diff --git a/components/legacy/Markdown/custom_tags/select-box.md b/components/Markdown/custom_tags/select-box.md
similarity index 100%
rename from components/legacy/Markdown/custom_tags/select-box.md
rename to components/Markdown/custom_tags/select-box.md
diff --git a/components/Markdown/demos/accordion.py b/components/Markdown/demos/accordion.py
new file mode 100644
index 0000000000000000000000000000000000000000..c91634b0d7e87d905f84bec5323adbf28600e3b9
--- /dev/null
+++ b/components/Markdown/demos/accordion.py
@@ -0,0 +1,27 @@
+import gradio as gr
+import modelscope_studio as mgr
+
+with gr.Blocks() as demo:
+ mgr.Markdown(f"""
+
+
+```json
+{{"text": "glorious weather", "resolution": "1024*1024"}}
+```
+
+
+
+Use `::accordion-title` to support markdown:
+
+
+
+::accordion-title[Using `tool`]
+
+```json
+{{"text": "glorious weather", "resolution": "1024*1024"}}
+```
+
+""")
+
+if __name__ == "__main__":
+ demo.queue().launch()
diff --git a/components/legacy/Markdown/demos/basic.py b/components/Markdown/demos/basic.py
similarity index 58%
rename from components/legacy/Markdown/demos/basic.py
rename to components/Markdown/demos/basic.py
index 4f2332a7604d8fa1d40dea3f9e0de6bd8e8dd5e1..2b9ab5b2dfc92d2dd6958fd715cc1e5c0008cbdd 100644
--- a/components/legacy/Markdown/demos/basic.py
+++ b/components/Markdown/demos/basic.py
@@ -1,8 +1,7 @@
import gradio as gr
-import modelscope_studio.components.base as ms
-import modelscope_studio.components.legacy as mgr
+import modelscope_studio as mgr
-with gr.Blocks() as demo, ms.Application():
+with gr.Blocks() as demo:
mgr.Markdown(
"This _example_ was **written** in [Markdown](https://en.wikipedia.org/wiki/Markdown)\n"
)
diff --git a/components/legacy/Markdown/demos/custom-tag.py b/components/Markdown/demos/custom-tag.py
similarity index 63%
rename from components/legacy/Markdown/demos/custom-tag.py
rename to components/Markdown/demos/custom-tag.py
index 8e053a563a6ad95cb3d61f63c5e25b1fc5f7f82b..162dfa19643937b07f50027bbcd8b5849164f80b 100644
--- a/components/legacy/Markdown/demos/custom-tag.py
+++ b/components/Markdown/demos/custom-tag.py
@@ -1,10 +1,9 @@
import gradio as gr
-import modelscope_studio.components.base as ms
-import modelscope_studio.components.legacy as mgr
+import modelscope_studio as mgr
-with gr.Blocks() as demo, ms.Application():
+with gr.Blocks() as demo:
mgr.Markdown(
- """
+ f"""
custom tag:
""",
custom_components={
@@ -12,7 +11,7 @@ custom tag:
"custom-tag": {
# The tag props.
"props": ["value"],
- # The tag template, use `{prop}` as placeholder.
+ # The tag template, use `{prop}` as placeholder。
"template": "
{value}
"
}
})
diff --git a/components/legacy/Markdown/demos/custom-tag2.py b/components/Markdown/demos/custom-tag2.py
similarity index 55%
rename from components/legacy/Markdown/demos/custom-tag2.py
rename to components/Markdown/demos/custom-tag2.py
index ecb3acefd0d171b1af15818cdcb04eb3f2f59c29..890cf51bb303d4689e5e686e41acb4ed1c0c98de 100644
--- a/components/legacy/Markdown/demos/custom-tag2.py
+++ b/components/Markdown/demos/custom-tag2.py
@@ -1,10 +1,9 @@
import gradio as gr
-import modelscope_studio.components.base as ms
-import modelscope_studio.components.legacy as mgr
+import modelscope_studio as mgr
-with gr.Blocks() as demo, ms.Application():
+with gr.Blocks() as demo:
mgr.Markdown(
- """
+ f"""
custom tag:
""",
custom_components={
@@ -15,29 +14,12 @@ custom tag:
# The `js` property should be a string containing a JavaScript Function.
"js":
"""
-(props, cc, { el, onMount, onUpdate }) => {
- // `onMount` will be called after the template first rendered
+(props, cc, { el, onMount }) => {
+ // `onMount` will be called after the template rendered
onMount(() => {
// `el` is the container element
console.log(el)
-
- // the return function will be called when the component is being unmounted
- return () => {
- console.log('unmount')
- }
- })
-
- // `onUpdate` will be called when the props changed
- onUpdate(() => {
- console.log(props)
})
- onUpdate(
- () => {
- console.log(props, 'after mount')
- },
- // By default, the callback will not be called when the component is being mounted. Set `callAfterMount` to true to enable it.
- { callAfterMount: true }
- )
console.log(props.children) // By default, `props` will be passed a property named `children`, which can get the content in the tag, such as 'xx' in 'xx'.
// The return value will be merged with `props` and passed to the template.
diff --git a/components/legacy/Markdown/demos/custom-tag3.py b/components/Markdown/demos/custom-tag3.py
similarity index 75%
rename from components/legacy/Markdown/demos/custom-tag3.py
rename to components/Markdown/demos/custom-tag3.py
index 6d92315c032aeaf5b87abb8f3db42a38a12ff92c..6d6f1f94990dbc47eb1542901f7035ec827cbfb9 100644
--- a/components/legacy/Markdown/demos/custom-tag3.py
+++ b/components/Markdown/demos/custom-tag3.py
@@ -2,21 +2,20 @@ import json
import os
import gradio as gr
-import modelscope_studio.components.base as ms
-import modelscope_studio.components.legacy as mgr
+import modelscope_studio as mgr
options = ["a", "b", "c"]
def resolve_assets(relative_path):
- return os.path.join(os.path.dirname(__file__), "../../resources",
+ return os.path.join(os.path.dirname(__file__), "../resources",
relative_path)
with open(resolve_assets("./custom_components/custom_select.js"), 'r') as f:
custom_select_js = f.read()
-with gr.Blocks() as demo, ms.Application():
+with gr.Blocks() as demo:
mgr.Markdown(value=f"""
custom tag:
""",
diff --git a/components/legacy/Markdown/demos/custom-tag4.py b/components/Markdown/demos/custom-tag4.py
similarity index 80%
rename from components/legacy/Markdown/demos/custom-tag4.py
rename to components/Markdown/demos/custom-tag4.py
index 405c52c095c7ce02713362d58a08cb06b0c67213..8fd5c5b9e991a315239d9b2f75bfbc698b3585d0 100644
--- a/components/legacy/Markdown/demos/custom-tag4.py
+++ b/components/Markdown/demos/custom-tag4.py
@@ -2,14 +2,13 @@ import json
import os
import gradio as gr
-import modelscope_studio.components.base as ms
-import modelscope_studio.components.legacy as mgr
+import modelscope_studio as mgr
options = ["a", "b", "c"]
def resolve_assets(relative_path):
- return os.path.join(os.path.dirname(__file__), "../../resources",
+ return os.path.join(os.path.dirname(__file__), "../resources",
relative_path)
@@ -22,7 +21,7 @@ def fn(data: gr.EventData):
print("custom value", data._data)
-with gr.Blocks() as demo, ms.Application():
+with gr.Blocks() as demo:
md = mgr.Markdown(value=f"""
custom tag:
""",
diff --git a/components/Markdown/demos/custom_tags/accordion/__pycache__/accordion-title.cpython-39.pyc b/components/Markdown/demos/custom_tags/accordion/__pycache__/accordion-title.cpython-39.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..bd14c555f641b6ae8309a21e2e57310b21cc0733
Binary files /dev/null and b/components/Markdown/demos/custom_tags/accordion/__pycache__/accordion-title.cpython-39.pyc differ
diff --git a/components/Markdown/demos/custom_tags/accordion/__pycache__/basic.cpython-39.pyc b/components/Markdown/demos/custom_tags/accordion/__pycache__/basic.cpython-39.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..2ee445e3e71ea028b1e9ab00f6744f8966fbeae2
Binary files /dev/null and b/components/Markdown/demos/custom_tags/accordion/__pycache__/basic.cpython-39.pyc differ
diff --git a/components/Markdown/demos/custom_tags/accordion/accordion-title.py b/components/Markdown/demos/custom_tags/accordion/accordion-title.py
new file mode 100644
index 0000000000000000000000000000000000000000..7901cc99b5fd77e53336ab72664240de4dc134c7
--- /dev/null
+++ b/components/Markdown/demos/custom_tags/accordion/accordion-title.py
@@ -0,0 +1,18 @@
+import gradio as gr
+import modelscope_studio as mgr
+
+with gr.Blocks() as demo:
+ mgr.Markdown(f"""
+
+
+::accordion-title[Using `tool`]
+
+```json
+{{"text": "glorious weather", "resolution": "1024*1024"}}
+```
+
+
+""")
+
+if __name__ == "__main__":
+ demo.queue().launch()
diff --git a/components/Markdown/demos/custom_tags/accordion/basic.py b/components/Markdown/demos/custom_tags/accordion/basic.py
new file mode 100644
index 0000000000000000000000000000000000000000..239dfdb2f7e1a871808024ec4ec1d5940ca19216
--- /dev/null
+++ b/components/Markdown/demos/custom_tags/accordion/basic.py
@@ -0,0 +1,16 @@
+import gradio as gr
+import modelscope_studio as mgr
+
+with gr.Blocks() as demo:
+ mgr.Markdown(f"""
+
+
+```json
+{{"text": "glorious weather", "resolution": "1024*1024"}}
+```
+
+
+""")
+
+if __name__ == "__main__":
+ demo.queue().launch()
diff --git a/components/Markdown/demos/custom_tags/select-box/__pycache__/basic.cpython-39.pyc b/components/Markdown/demos/custom_tags/select-box/__pycache__/basic.cpython-39.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..8b37417e58d758fe5b0ee364cfa63e43df70d042
Binary files /dev/null and b/components/Markdown/demos/custom_tags/select-box/__pycache__/basic.cpython-39.pyc differ
diff --git a/components/Markdown/demos/custom_tags/select-box/__pycache__/card_shape.cpython-39.pyc b/components/Markdown/demos/custom_tags/select-box/__pycache__/card_shape.cpython-39.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..b50b449d8f582658710ec6d5a11835216878d724
Binary files /dev/null and b/components/Markdown/demos/custom_tags/select-box/__pycache__/card_shape.cpython-39.pyc differ
diff --git a/components/Markdown/demos/custom_tags/select-box/__pycache__/card_shape_width_auto.cpython-39.pyc b/components/Markdown/demos/custom_tags/select-box/__pycache__/card_shape_width_auto.cpython-39.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..74f2749a5a32228d2414e17bee95546778928b0f
Binary files /dev/null and b/components/Markdown/demos/custom_tags/select-box/__pycache__/card_shape_width_auto.cpython-39.pyc differ
diff --git a/components/Markdown/demos/custom_tags/select-box/__pycache__/python_events.cpython-39.pyc b/components/Markdown/demos/custom_tags/select-box/__pycache__/python_events.cpython-39.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..5b6e89295cf10f37c12596d58000e2c6215fe29f
Binary files /dev/null and b/components/Markdown/demos/custom_tags/select-box/__pycache__/python_events.cpython-39.pyc differ
diff --git a/components/legacy/Markdown/demos/custom_tags/select-box/basic.py b/components/Markdown/demos/custom_tags/select-box/basic.py
similarity index 57%
rename from components/legacy/Markdown/demos/custom_tags/select-box/basic.py
rename to components/Markdown/demos/custom_tags/select-box/basic.py
index da1858770f574e668eaf20f629582d0108f58315..52fea57ab46afeae1298946cd380395a8707c81f 100644
--- a/components/legacy/Markdown/demos/custom_tags/select-box/basic.py
+++ b/components/Markdown/demos/custom_tags/select-box/basic.py
@@ -1,18 +1,17 @@
import json
import gradio as gr
-import modelscope_studio.components.base as ms
-import modelscope_studio.components.legacy as mgr
+import modelscope_studio as mgr
options = [{"label": "A", "value": "a"}, "b", "c"]
-with gr.Blocks() as demo, ms.Application():
+with gr.Blocks() as demo:
mgr.Markdown(
f"""Single Select:
-Multiple Select:
+Multiple Select:
-Vertical Direction:
+Vertical Direction:
""", )
diff --git a/components/legacy/Markdown/demos/custom_tags/select-box/card_shape.py b/components/Markdown/demos/custom_tags/select-box/card_shape.py
similarity index 68%
rename from components/legacy/Markdown/demos/custom_tags/select-box/card_shape.py
rename to components/Markdown/demos/custom_tags/select-box/card_shape.py
index 3ba4fccd6e21e17a6e474833a2eaeab1c2c2d766..40c7f83b8c7d59369ced2e2590a9a4965ab3a80f 100644
--- a/components/legacy/Markdown/demos/custom_tags/select-box/card_shape.py
+++ b/components/Markdown/demos/custom_tags/select-box/card_shape.py
@@ -2,29 +2,27 @@ import json
import os
import gradio as gr
-import modelscope_studio.components.base as ms
-import modelscope_studio.components.legacy as mgr
+import modelscope_studio as mgr
# Card shape supports setting `imgSrc` as the cover.
options = [{
"label":
"A",
"imgSrc":
- os.path.join(os.path.dirname(__file__),
- '../../../../resources/screen.jpeg'),
+ os.path.join(os.path.dirname(__file__), '../../../resources/screen.jpeg'),
"value":
"a"
}, "b", "c", "d"]
-with gr.Blocks() as demo, ms.Application():
+with gr.Blocks() as demo:
mgr.Markdown(
f"""
-Custom Columns:
+Custom Columns:
-Vertical Direction:
+Vertical Direction:
""")
diff --git a/components/legacy/Markdown/demos/custom_tags/select-box/card_shape_width_auto.py b/components/Markdown/demos/custom_tags/select-box/card_shape_width_auto.py
similarity index 64%
rename from components/legacy/Markdown/demos/custom_tags/select-box/card_shape_width_auto.py
rename to components/Markdown/demos/custom_tags/select-box/card_shape_width_auto.py
index 2ea9fb95524065c62dc2be0d183de85b5499be31..f71f1fa0aa338d896e20b4f1334ccaf6ce8f9ed5 100644
--- a/components/legacy/Markdown/demos/custom_tags/select-box/card_shape_width_auto.py
+++ b/components/Markdown/demos/custom_tags/select-box/card_shape_width_auto.py
@@ -2,21 +2,19 @@ import json
import os
import gradio as gr
-import modelscope_studio.components.base as ms
-import modelscope_studio.components.legacy as mgr
+import modelscope_studio as mgr
# Card shape supports setting `imgSrc` as the cover.
options = [{
"label":
"A",
"imgSrc":
- os.path.join(os.path.dirname(__file__),
- '../../../../resources/screen.jpeg'),
+ os.path.join(os.path.dirname(__file__), '../../../resources/screen.jpeg'),
"value":
"a"
}, "b", "c", "d"]
-with gr.Blocks() as demo, ms.Application():
+with gr.Blocks() as demo:
mgr.Markdown(
# item-width="auto"
f"""
diff --git a/components/legacy/Markdown/demos/custom_tags/select-box/python_events.py b/components/Markdown/demos/custom_tags/select-box/python_events.py
similarity index 77%
rename from components/legacy/Markdown/demos/custom_tags/select-box/python_events.py
rename to components/Markdown/demos/custom_tags/select-box/python_events.py
index 4cff53b6a76d19e89c0cf2dbbb56750986cef57b..d77b89a4d97312456f8780e1e43a494036bcfb3c 100644
--- a/components/legacy/Markdown/demos/custom_tags/select-box/python_events.py
+++ b/components/Markdown/demos/custom_tags/select-box/python_events.py
@@ -1,8 +1,7 @@
import json
import gradio as gr
-import modelscope_studio.components.base as ms
-import modelscope_studio.components.legacy as mgr
+import modelscope_studio as mgr
options = [{"label": "A", "value": "a"}, "b", "c"]
@@ -14,7 +13,7 @@ def fn(data: gr.EventData):
) # 'a' or 'b' or 'c', the value set in the options.
-with gr.Blocks() as demo, ms.Application():
+with gr.Blocks() as demo:
md = mgr.Markdown(
f""
)
diff --git a/components/legacy/Markdown/demos/multimodal.py b/components/Markdown/demos/multimodal.py
similarity index 61%
rename from components/legacy/Markdown/demos/multimodal.py
rename to components/Markdown/demos/multimodal.py
index ec205ef7c092960ba34936aebe952e78f42b9bf2..f056314eb299226ce151af44fa110bddc50781dd 100644
--- a/components/legacy/Markdown/demos/multimodal.py
+++ b/components/Markdown/demos/multimodal.py
@@ -1,16 +1,15 @@
import os
import gradio as gr
-import modelscope_studio.components.base as ms
-import modelscope_studio.components.legacy as mgr
+import modelscope_studio as mgr
def resolve_assets(relative_path):
- return os.path.join(os.path.dirname(__file__), "../../resources",
+ return os.path.join(os.path.dirname(__file__), "../resources",
relative_path)
-with gr.Blocks() as demo, ms.Application():
+with gr.Blocks() as demo:
mgr.Markdown(f"""
Image
@@ -18,6 +17,10 @@ Image
+Video
+
+
+
Audio
diff --git a/components/legacy/Markdown/demos/select-box.py b/components/Markdown/demos/select-box.py
similarity index 73%
rename from components/legacy/Markdown/demos/select-box.py
rename to components/Markdown/demos/select-box.py
index ae2cff107cd5e2a8f156d7de97866f9b75012024..7f5da713c7f13f7a1c09e6dbe61e658866e5005e 100644
--- a/components/legacy/Markdown/demos/select-box.py
+++ b/components/Markdown/demos/select-box.py
@@ -1,19 +1,18 @@
import json
import gradio as gr
-import modelscope_studio.components.base as ms
-import modelscope_studio.components.legacy as mgr
+import modelscope_studio as mgr
# `label` will display on the page, and `value` is the actual selected value.
options = [{"label": "A", "value": "a"}, "b", "c"]
-with gr.Blocks() as demo, ms.Application():
+with gr.Blocks() as demo:
mgr.Markdown(f"""
Single Select:
-Multiple Select:
+Multiple Select:
-Vertical Direction:
+Vertical Direction:
diff --git a/components/Markdown/resources/audio.wav b/components/Markdown/resources/audio.wav
new file mode 100644
index 0000000000000000000000000000000000000000..105190ad88e2e177540361de340e54feb1587f3c
Binary files /dev/null and b/components/Markdown/resources/audio.wav differ
diff --git a/components/Markdown/resources/bot.jpeg b/components/Markdown/resources/bot.jpeg
new file mode 100644
index 0000000000000000000000000000000000000000..5fde8cc45f61b677c0581e6889b11e269c35be08
Binary files /dev/null and b/components/Markdown/resources/bot.jpeg differ
diff --git a/components/Markdown/resources/custom_components/custom_select.js b/components/Markdown/resources/custom_components/custom_select.js
new file mode 100644
index 0000000000000000000000000000000000000000..ca7e2ae712ca53eff775d1f5b22d9c004720db0b
--- /dev/null
+++ b/components/Markdown/resources/custom_components/custom_select.js
@@ -0,0 +1,26 @@
+(props, cc, { el, onMount }) => {
+ const options = JSON.parse(props.options);
+ el.innerHTML = `
+ ${options
+ .map((option) => {
+ return `
+
+
`;
+ })
+ .join('')}
+ `;
+ onMount(() => {
+ const inputs = Array.from(el.getElementsByTagName('input'));
+ Array.from(el.getElementsByTagName('label')).forEach((label, i) => {
+ label.addEventListener('click', () => {
+ inputs.forEach((input) => {
+ input.checked = false;
+ });
+ const input = label.getElementsByTagName('input')[0];
+ input.checked = true;
+ // Use cc.dispatch to trigger events.
+ cc.dispatch(options[i]);
+ });
+ });
+ });
+};
diff --git a/components/Markdown/resources/dog.mp4 b/components/Markdown/resources/dog.mp4
new file mode 100644
index 0000000000000000000000000000000000000000..062b9c81317de43f392c56e9e03444bf8cc31d51
--- /dev/null
+++ b/components/Markdown/resources/dog.mp4
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:39d086ce29e48cf76e5042d2f3f0611ee46575f70fa3dc0c40dd4cfffde3d933
+size 8626383
diff --git a/components/Markdown/resources/screen.jpeg b/components/Markdown/resources/screen.jpeg
new file mode 100644
index 0000000000000000000000000000000000000000..574735acb117e86c5c0850e2b5489b8f8efa20cc
Binary files /dev/null and b/components/Markdown/resources/screen.jpeg differ
diff --git a/components/Markdown/resources/user.jpeg b/components/Markdown/resources/user.jpeg
new file mode 100644
index 0000000000000000000000000000000000000000..536948b6bd19cb0b49c44b74e2790198301520e5
Binary files /dev/null and b/components/Markdown/resources/user.jpeg differ
diff --git a/components/legacy/MultimodalInput/README-zh_CN.md b/components/MultimodalInput/README-zh_CN.md
similarity index 100%
rename from components/legacy/MultimodalInput/README-zh_CN.md
rename to components/MultimodalInput/README-zh_CN.md
diff --git a/components/legacy/MultimodalInput/README.md b/components/MultimodalInput/README.md
similarity index 97%
rename from components/legacy/MultimodalInput/README.md
rename to components/MultimodalInput/README.md
index e82c502fd4b3ae76deb07aeed336389461442102..b3e1441b24f985bd555561f1384680efcaae6ba5 100644
--- a/components/legacy/MultimodalInput/README.md
+++ b/components/MultimodalInput/README.md
@@ -43,7 +43,7 @@ class MultimodalInputData(GradioModel):
| Attribute | Type | Default Value | Description |
| ------------------- | ----------------------------------------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| sources | List[Literal['upload', 'microphone', 'webcam']] | ['upload'] | A list of types for uploading files. "upload" provides an upload file button. "microphone" supports user audio input. "webcam" supports user photography to generate images or videos. |
+| sources | list[Literal['upload', 'microphone', 'webcam']] | ['upload'] | A list of types for uploading files. "upload" provides an upload file button. "microphone" supports user audio input. "webcam" supports user photography to generate images or videos. |
| webcam_props | dict | None | webcam component properties, currently supports passing mirror_webcam(bool), include_audio(bool) |
| upload_button_props | dict | None | Upload file button properties, same as gradio UploadButton |
| submit_button_props | dict | None | Submit button properties, same as gradio Button |
diff --git a/components/antd/auto_complete/app.py b/components/MultimodalInput/app.py
similarity index 72%
rename from components/antd/auto_complete/app.py
rename to components/MultimodalInput/app.py
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..77372ef291165f2cf77a8944f3f8b18773972190 100644
--- a/components/antd/auto_complete/app.py
+++ b/components/MultimodalInput/app.py
@@ -1,4 +1,4 @@
-from helper.Docs import Docs
+from components.Docs import Docs
docs = Docs(__file__)
diff --git a/components/legacy/MultimodalInput/demos/basic.py b/components/MultimodalInput/demos/basic.py
similarity index 63%
rename from components/legacy/MultimodalInput/demos/basic.py
rename to components/MultimodalInput/demos/basic.py
index ee3ade2b6ec877c87bf3a9bed8e9d1a9798ffdf6..55249c4b3433c88a1575c13f6ab75910b8bab35b 100644
--- a/components/legacy/MultimodalInput/demos/basic.py
+++ b/components/MultimodalInput/demos/basic.py
@@ -1,6 +1,5 @@
import gradio as gr
-import modelscope_studio.components.base as ms
-import modelscope_studio.components.legacy as mgr
+import modelscope_studio as mgr
def fn(value):
@@ -8,7 +7,7 @@ def fn(value):
print(value.text, value.files)
-with gr.Blocks() as demo, ms.Application():
+with gr.Blocks() as demo:
input = mgr.MultimodalInput()
input.change(fn=fn, inputs=[input])
diff --git a/components/legacy/MultimodalInput/demos/config_buttons.py b/components/MultimodalInput/demos/config_buttons.py
similarity index 69%
rename from components/legacy/MultimodalInput/demos/config_buttons.py
rename to components/MultimodalInput/demos/config_buttons.py
index 84a5a4bde4692399834050f246929689296d96a2..6b73382be2cc6dba792cd0275e8a668d08c21d05 100644
--- a/components/legacy/MultimodalInput/demos/config_buttons.py
+++ b/components/MultimodalInput/demos/config_buttons.py
@@ -1,13 +1,12 @@
import gradio as gr
-import modelscope_studio.components.base as ms
-import modelscope_studio.components.legacy as mgr
+import modelscope_studio as mgr
def fn(value):
print(value.text, value.files)
-with gr.Blocks() as demo, ms.Application():
+with gr.Blocks() as demo:
input = mgr.MultimodalInput(upload_button_props=dict(variant="primary"),
submit_button_props=dict(visible=False))
input.change(fn=fn, inputs=[input])
diff --git a/components/legacy/MultimodalInput/demos/upload_sources.py b/components/MultimodalInput/demos/upload_sources.py
similarity index 63%
rename from components/legacy/MultimodalInput/demos/upload_sources.py
rename to components/MultimodalInput/demos/upload_sources.py
index 7358329e8b08c8962f38d25fe1caad5dcf350820..e9caff69a0791dde1583d8cb6069765066c79955 100644
--- a/components/legacy/MultimodalInput/demos/upload_sources.py
+++ b/components/MultimodalInput/demos/upload_sources.py
@@ -1,13 +1,12 @@
import gradio as gr
-import modelscope_studio.components.base as ms
-import modelscope_studio.components.legacy as mgr
+import modelscope_studio as mgr
def fn(value):
print(value.text, value.files)
-with gr.Blocks() as demo, ms.Application():
+with gr.Blocks() as demo:
input = mgr.MultimodalInput(sources=["upload", "microphone", "webcam"])
input.change(fn=fn, inputs=[input])
diff --git a/components/legacy/MultimodalInput/demos/with_chatbot.py b/components/MultimodalInput/demos/with_chatbot.py
similarity index 84%
rename from components/legacy/MultimodalInput/demos/with_chatbot.py
rename to components/MultimodalInput/demos/with_chatbot.py
index 64cf913c06f736e8586d81e024059a81e74a1921..fe48acad1ea0cae316ce54468659e7c345f247fb 100644
--- a/components/legacy/MultimodalInput/demos/with_chatbot.py
+++ b/components/MultimodalInput/demos/with_chatbot.py
@@ -1,8 +1,7 @@
import time
import gradio as gr
-import modelscope_studio.components.base as ms
-import modelscope_studio.components.legacy as mgr
+import modelscope_studio as mgr
def fn(input, chatbot):
@@ -24,7 +23,7 @@ def flushed():
return mgr.MultimodalInput(interactive=True)
-with gr.Blocks() as demo, ms.Application():
+with gr.Blocks() as demo:
user_chatbot = mgr.Chatbot()
user_input = mgr.MultimodalInput()
user_input.submit(fn=fn,
diff --git a/components/antd/affix/README-zh_CN.md b/components/antd/affix/README-zh_CN.md
deleted file mode 100644
index e9742b478122d22fd70a6ae5d3553ae72dfeb756..0000000000000000000000000000000000000000
--- a/components/antd/affix/README-zh_CN.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# Affix
-
-Stick an element to the viewport. See [Ant Design](https://ant.design/components/affix/) for more information.
-
-## Examples
-
-
-
diff --git a/components/antd/affix/README.md b/components/antd/affix/README.md
deleted file mode 100644
index e9742b478122d22fd70a6ae5d3553ae72dfeb756..0000000000000000000000000000000000000000
--- a/components/antd/affix/README.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# Affix
-
-Stick an element to the viewport. See [Ant Design](https://ant.design/components/affix/) for more information.
-
-## Examples
-
-
-
diff --git a/components/antd/affix/app.py b/components/antd/affix/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/affix/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/affix/demos/basic.py b/components/antd/affix/demos/basic.py
deleted file mode 100644
index 5768418d8f86dc858a6bc645e575782651869cf3..0000000000000000000000000000000000000000
--- a/components/antd/affix/demos/basic.py
+++ /dev/null
@@ -1,15 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Affix(offset_top=100):
- antd.Button("Affix to top", type="primary")
- antd.Divider()
- with antd.Affix(offset_bottom=100):
- antd.Button("Affix to bottom", type="primary")
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/affix/demos/container_to_scroll.py b/components/antd/affix/demos/container_to_scroll.py
deleted file mode 100644
index 4694d4cde866e5e7b56bc6ffe9b5a85f25e2ce73..0000000000000000000000000000000000000000
--- a/components/antd/affix/demos/container_to_scroll.py
+++ /dev/null
@@ -1,26 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with ms.Div(elem_id="affix_container",
- elem_style={
- "width": '100%',
- "height": 100,
- "overflow": 'auto',
- "boxShadow": '0 0 0 1px #1677ff',
- "scrollbarWidth": 'thin',
- "scrollbarGutter": 'stable',
- }):
- with ms.Div(elem_style=dict(width="100%", height=1000)):
- with antd.Affix(
- get_target=
- "() => document.querySelector('#affix_container')"
- ):
- antd.Button("Fixed at the top of container",
- type="primary")
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/alert/README-zh_CN.md b/components/antd/alert/README-zh_CN.md
deleted file mode 100644
index 45047d8f468d60bb2f71ee65b30e6fb155321925..0000000000000000000000000000000000000000
--- a/components/antd/alert/README-zh_CN.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Alert
-
-Display warning messages that require attention. See [Ant Design](https://ant.design/components/alert/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/alert/README.md b/components/antd/alert/README.md
deleted file mode 100644
index 45047d8f468d60bb2f71ee65b30e6fb155321925..0000000000000000000000000000000000000000
--- a/components/antd/alert/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Alert
-
-Display warning messages that require attention. See [Ant Design](https://ant.design/components/alert/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/alert/app.py b/components/antd/alert/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/alert/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/alert/demos/basic.py b/components/antd/alert/demos/basic.py
deleted file mode 100644
index cb0ecef2d12d91f3d2b0a8043a19abf9a9d0f5fe..0000000000000000000000000000000000000000
--- a/components/antd/alert/demos/basic.py
+++ /dev/null
@@ -1,39 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-data = [{
- "message": "Success Text",
- "description":
- "Success Description Success Description Success Description Success Description",
- "type": "success"
-}, {
- "message": "Info Text",
- "description":
- "Info Description Info Description Info Description Info Description",
- "type": "info"
-}, {
- "message": "Warning Text",
- "description":
- "Warning Description Warning Description Warning Description Warning Description",
- "type": "warning"
-}, {
- "message": "Error Text",
- "description":
- "Error Description Error Description Error Description Error Description",
- "type": "error"
-}]
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Space(direction="vertical"):
- for item in data:
- antd.Alert(message=item["message"],
- description=item["description"],
- type=item["type"],
- closable=True,
- show_icon=True)
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/anchor/README-zh_CN.md b/components/antd/anchor/README-zh_CN.md
deleted file mode 100644
index 24d87d88b2f7f685a65f42d893dda2e2534e8503..0000000000000000000000000000000000000000
--- a/components/antd/anchor/README-zh_CN.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Anchor
-
-Hyperlinks to scroll on one page. See [Ant Design](https://ant.design/components/anchor/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/anchor/README.md b/components/antd/anchor/README.md
deleted file mode 100644
index 24d87d88b2f7f685a65f42d893dda2e2534e8503..0000000000000000000000000000000000000000
--- a/components/antd/anchor/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Anchor
-
-Hyperlinks to scroll on one page. See [Ant Design](https://ant.design/components/anchor/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/anchor/demos/basic.py b/components/antd/anchor/demos/basic.py
deleted file mode 100644
index f4a994dcc9c6bec84429e594d50f1c537a673f86..0000000000000000000000000000000000000000
--- a/components/antd/anchor/demos/basic.py
+++ /dev/null
@@ -1,37 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Row():
- with antd.Col(span=16):
- with ms.Div(elem_style=dict(maxHeight="700px",
- overflow="auto")):
- ms.Div(elem_id="part-1",
- elem_style=dict(
- height="100vh",
- background="rgba(255,0,0,0.02)"))
- ms.Div(elem_id="part-2",
- elem_style=dict(
- height="100vh",
- background="rgba(0,255,0,0.02)"))
- ms.Div(elem_id="part-3",
- elem_style=dict(
- height="100vh",
- background="rgba(0,0,255,0.02)"))
- with antd.Col(span=8):
- with antd.Anchor():
- with antd.Anchor.Item(href="#part-1", key="part-1"):
- with ms.Slot("title"):
- antd.Typography.Title("Part 1")
- antd.Anchor.Item(title="Part 2",
- href="#part-2",
- key="part-2")
- antd.Anchor.Item(title="Part 3",
- href="#part-3",
- key="part-3")
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/auto_complete/README-zh_CN.md b/components/antd/auto_complete/README-zh_CN.md
deleted file mode 100644
index 8c294c7df5740fc8156af865fbc70c55d88c2b4c..0000000000000000000000000000000000000000
--- a/components/antd/auto_complete/README-zh_CN.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# AutoComplete
-
-Autocomplete function of input field. See [Ant Design](https://ant.design/components/auto-complete/) for more information.
-
-## Examples
-
-
-
diff --git a/components/antd/auto_complete/README.md b/components/antd/auto_complete/README.md
deleted file mode 100644
index 8c294c7df5740fc8156af865fbc70c55d88c2b4c..0000000000000000000000000000000000000000
--- a/components/antd/auto_complete/README.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# AutoComplete
-
-Autocomplete function of input field. See [Ant Design](https://ant.design/components/auto-complete/) for more information.
-
-## Examples
-
-
-
diff --git a/components/antd/auto_complete/demos/basic.py b/components/antd/auto_complete/demos/basic.py
deleted file mode 100644
index 59bb5d5986efa5ad12ccde0661d4afba83af6130..0000000000000000000000000000000000000000
--- a/components/antd/auto_complete/demos/basic.py
+++ /dev/null
@@ -1,31 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-
-def on_search(e: gr.EventData):
- text = e._data["payload"][0]
- domains = ["gmail.com", "163.com", "qq.com"]
- if not text or "@" in text:
- return gr.update(options=[])
- return gr.update(options=[{
- "value": f"{text}@{domain}",
- "label": f"{text}@{domain}"
- } for domain in domains])
-
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- auto_complete = antd.AutoComplete(placeholder="Typing here...",
- elem_style=dict(width=200))
- antd.Divider("Customize Input Component")
- with antd.AutoComplete() as customize_auto_complete:
- with ms.Slot("children"):
- antd.Input.Textarea(placeholder="Typing here...")
- auto_complete.search(on_search, outputs=[auto_complete])
- customize_auto_complete.search(on_search,
- outputs=[customize_auto_complete])
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/auto_complete/demos/lookup_patterns.py b/components/antd/auto_complete/demos/lookup_patterns.py
deleted file mode 100644
index 9bae8e9b63322f6914243a55af65de5688771f4a..0000000000000000000000000000000000000000
--- a/components/antd/auto_complete/demos/lookup_patterns.py
+++ /dev/null
@@ -1,56 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-
-def Title(title: str):
- with antd.Flex(align="center", justify="space-between"):
- ms.Span(title)
-
- antd.Button("more",
- type="link",
- href="https://www.google.com/search?q=antd",
- href_target="_blank")
-
-
-def AutoCompleteSubOption(title: str, count: int):
- with antd.AutoComplete.Option(value=title):
- with ms.Slot("label"):
- with antd.Flex(align="center", justify="space-between"):
- ms.Text(title)
- with ms.Span():
- antd.Icon("UserOutlined")
- ms.Text(count)
-
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.AutoComplete(elem_style=dict(width=250),
- size="large",
- popup_match_select_width=500):
- with ms.Slot("children"):
- antd.Input.Search(size="large",
- placeholder="Typing here...")
- with ms.Slot("options"):
- with antd.AutoComplete.Option():
- with ms.Slot("label"):
- Title("Libraries")
- with ms.Slot("options"):
- AutoCompleteSubOption("Ant Design", 10000)
- AutoCompleteSubOption('AntDesign UI', 10600)
- with antd.AutoComplete.Option():
- with ms.Slot("label"):
- Title("Solutions")
- with ms.Slot("options"):
- AutoCompleteSubOption('AntDesign UI FAQ', 60100)
- AutoCompleteSubOption('AntDesign FAQ', 30010)
- with antd.AutoComplete.Option():
- with ms.Slot("label"):
- Title("Articles")
- with ms.Slot("options"):
- AutoCompleteSubOption('AntDesign design language',
- 100000)
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/avatar/README-zh_CN.md b/components/antd/avatar/README-zh_CN.md
deleted file mode 100644
index 880d78e959eeae91c198ffed8c93efc7a98f7e7a..0000000000000000000000000000000000000000
--- a/components/antd/avatar/README-zh_CN.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# Avatar
-
-Used to represent users or things, supporting the display of images, icons, or characters. See [Ant Design](https://ant.design/components/avatar/) for more information.
-
-## Examples
-
-
-
diff --git a/components/antd/avatar/README.md b/components/antd/avatar/README.md
deleted file mode 100644
index 880d78e959eeae91c198ffed8c93efc7a98f7e7a..0000000000000000000000000000000000000000
--- a/components/antd/avatar/README.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# Avatar
-
-Used to represent users or things, supporting the display of images, icons, or characters. See [Ant Design](https://ant.design/components/avatar/) for more information.
-
-## Examples
-
-
-
diff --git a/components/antd/avatar/app.py b/components/antd/avatar/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/avatar/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/avatar/demos/basic.py b/components/antd/avatar/demos/basic.py
deleted file mode 100644
index 920ce28b432c0084310267a36a8419389f548ac8..0000000000000000000000000000000000000000
--- a/components/antd/avatar/demos/basic.py
+++ /dev/null
@@ -1,42 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Space(size=16, wrap=True):
- with antd.Avatar():
- with ms.Slot("icon"):
- antd.Icon("UserOutlined")
- with antd.Avatar():
- ms.Text('U')
- with antd.Avatar(shape="square"):
- ms.Text("USER")
- antd.Avatar(
- "https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg"
- )
- with antd.Avatar():
- with ms.Slot("src"):
- antd.Image(
- "https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg",
- alt="avatar")
- with antd.Avatar(elem_style=dict(backgroundColor='#fde3cf',
- color='#f56a00')):
- ms.Text("U")
- with antd.Avatar(elem_style=dict(backgroundColor='#87d068')):
- with ms.Slot("icon"):
- antd.Icon("UserOutlined")
-
- antd.Divider("With Badge")
- with antd.Space(size=24):
- with antd.Badge(count=1):
- with antd.Avatar(shape="square"):
- with ms.Slot("icon"):
- antd.Icon("UserOutlined")
- with antd.Badge(dot=True):
- with antd.Avatar(shape="square"):
- with ms.Slot("icon"):
- antd.Icon("UserOutlined")
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/avatar/demos/group.py b/components/antd/avatar/demos/group.py
deleted file mode 100644
index d8b3075b6a21ef876f94114afc9e04d101a46c0d..0000000000000000000000000000000000000000
--- a/components/antd/avatar/demos/group.py
+++ /dev/null
@@ -1,98 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Avatar.Group():
- antd.Avatar(
- value="https://api.dicebear.com/7.x/miniavs/svg?seed=1")
- with antd.Avatar(elem_style=dict(backgroundColor="#f56a00")):
- ms.Text("K")
- with antd.Tooltip(title="Ant User", placement="top"):
- with antd.Avatar(elem_style=dict(
- backgroundColor="#87d068")):
- with ms.Slot("icon"):
- antd.Icon("UserOutlined")
- with antd.Avatar(elem_style=dict(backgroundColor="#1677ff")):
- with ms.Slot("icon"):
- antd.Icon("AntDesignOutlined")
-
- antd.Divider()
-
- with antd.Avatar.Group(max=dict(
- count=2,
- style=dict(color="#f56a00", backgroundColor="#fde3cf"))):
- antd.Avatar(
- value="https://api.dicebear.com/7.x/miniavs/svg?seed=2")
- with antd.Avatar(elem_style=dict(backgroundColor="#f56a00")):
- ms.Text("K")
- with antd.Tooltip(title="Ant User", placement="top"):
- with antd.Avatar(elem_style=dict(
- backgroundColor="#87d068")):
- with ms.Slot("icon"):
- antd.Icon("UserOutlined")
- with antd.Avatar(elem_style=dict(backgroundColor="#1677ff")):
- with ms.Slot("icon"):
- antd.Icon("AntDesignOutlined")
-
- antd.Divider()
-
- with antd.Avatar.Group(size="large",
- max=dict(count=2,
- style=dict(
- color="#f56a00",
- backgroundColor="#fde3cf"))):
- antd.Avatar(
- value="https://api.dicebear.com/7.x/miniavs/svg?seed=3")
- with antd.Avatar(elem_style=dict(backgroundColor="#f56a00")):
- ms.Text("K")
- with antd.Tooltip(title="Ant User", placement="top"):
- with antd.Avatar(elem_style=dict(
- backgroundColor="#87d068")):
- with ms.Slot("icon"):
- antd.Icon("UserOutlined")
- with antd.Avatar(elem_style=dict(backgroundColor="#1677ff")):
- with ms.Slot("icon"):
- antd.Icon("AntDesignOutlined")
-
- antd.Divider()
-
- with antd.Avatar.Group(size="large",
- max=dict(count=2,
- style=dict(
- color="#f56a00",
- backgroundColor="#fde3cf",
- cursor="pointer"),
- popover=dict(trigger="click"))):
- antd.Avatar(
- value=
- "https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png"
- )
- with antd.Avatar(elem_style=dict(backgroundColor="#f56a00")):
- ms.Text("K")
- with antd.Tooltip(title="Ant User", placement="top"):
- with antd.Avatar(elem_style=dict(
- backgroundColor="#87d068")):
- with ms.Slot("icon"):
- antd.Icon("UserOutlined")
- with antd.Avatar(elem_style=dict(backgroundColor="#1677ff")):
- with ms.Slot("icon"):
- antd.Icon("AntDesignOutlined")
-
- antd.Divider()
-
- with antd.Avatar.Group(shape="square"):
- with antd.Avatar(elem_style=dict(backgroundColor="#fde3cf")):
- ms.Text("A")
- with antd.Avatar(elem_style=dict(backgroundColor="#f56a00")):
- ms.Text("K")
- with antd.Avatar(elem_style=dict(backgroundColor="#87d068")):
- with ms.Slot("icon"):
- antd.Icon("UserOutlined")
- with antd.Avatar(elem_style=dict(backgroundColor="#1677ff")):
- with ms.Slot("icon"):
- antd.Icon("AntDesignOutlined")
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/badge/README-zh_CN.md b/components/antd/badge/README-zh_CN.md
deleted file mode 100644
index df072fbfa46e52aa468764b7ed0e5e0b5628076e..0000000000000000000000000000000000000000
--- a/components/antd/badge/README-zh_CN.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# Badge
-
-Small numerical value or status descriptor for UI elements. See [Ant Design](https://ant.design/components/badge/) for more information.
-
-## Examples
-
-
-
diff --git a/components/antd/badge/README.md b/components/antd/badge/README.md
deleted file mode 100644
index df072fbfa46e52aa468764b7ed0e5e0b5628076e..0000000000000000000000000000000000000000
--- a/components/antd/badge/README.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# Badge
-
-Small numerical value or status descriptor for UI elements. See [Ant Design](https://ant.design/components/badge/) for more information.
-
-## Examples
-
-
-
diff --git a/components/antd/badge/app.py b/components/antd/badge/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/badge/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/badge/demos/basic.py b/components/antd/badge/demos/basic.py
deleted file mode 100644
index 3110334fb5ebd854435d6d9754751f98fcf302e6..0000000000000000000000000000000000000000
--- a/components/antd/badge/demos/basic.py
+++ /dev/null
@@ -1,35 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Space(size="middle"):
- with antd.Badge(count=5):
- antd.Avatar(shape="square", size="large")
-
- with antd.Badge(count=0, show_zero=True):
- antd.Avatar(shape="square", size="large")
-
- with antd.Badge(elem_style=dict(color="#f5222d")):
- with ms.Slot("count"):
- antd.Icon("ClockCircleOutlined")
- antd.Avatar(shape="square", size="large")
- with antd.Badge(count=99, overflow_count=10):
- antd.Avatar(shape="square", size="large")
- with antd.Badge(count=1000, overflow_count=999):
- antd.Avatar(shape="square", size="large")
-
- with antd.Badge(dot=True):
- antd.Icon("NotificationOutlined",
- elem_style=dict(fontSize="16"))
- antd.Divider("Status")
- with antd.Space(direction="vertical"):
- antd.Badge(status="success", text="Success")
- antd.Badge(status="error", text="Error")
- antd.Badge(status="default", text="Default")
- antd.Badge(status="processing", text="Processing")
- antd.Badge(status="warning", text="Warning")
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/badge/demos/ribbon.py b/components/antd/badge/demos/ribbon.py
deleted file mode 100644
index 9dd36c5883d642564a3525bb5541af5dee33ce0d..0000000000000000000000000000000000000000
--- a/components/antd/badge/demos/ribbon.py
+++ /dev/null
@@ -1,51 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Space(direction="vertical",
- size="middle",
- elem_style=dict(width="100%")):
- with antd.Badge.Ribbon(text="Hippies"):
- with antd.Card(title="Pushes open the window",
- size="small"):
- ms.Text("and raises the spyglass.")
-
- with antd.Badge.Ribbon(text="Hippies", color="pink"):
- with antd.Card(title="Pushes open the window",
- size="small"):
- ms.Text("and raises the spyglass.")
-
- with antd.Badge.Ribbon(text="Hippies", color="red"):
- with antd.Card(title="Pushes open the window",
- size="small"):
- ms.Text("and raises the spyglass.")
-
- with antd.Badge.Ribbon(text="Hippies", color="cyan"):
- with antd.Card(title="Pushes open the window",
- size="small"):
- ms.Text("and raises the spyglass.")
-
- with antd.Badge.Ribbon(text="Hippies", color="green"):
- with antd.Card(title="Pushes open the window",
- size="small"):
- ms.Text("and raises the spyglass.")
-
- with antd.Badge.Ribbon(text="Hippies", color="purple"):
- with antd.Card(title="Pushes open the window",
- size="small"):
- ms.Text("and raises the spyglass.")
-
- with antd.Badge.Ribbon(text="Hippies", color="volcano"):
- with antd.Card(title="Pushes open the window",
- size="small"):
- ms.Text("and raises the spyglass.")
-
- with antd.Badge.Ribbon(text="Hippies", color="magenta"):
- with antd.Card(title="Pushes open the window",
- size="small"):
- ms.Text("and raises the spyglass.")
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/breadcrumb/README-zh_CN.md b/components/antd/breadcrumb/README-zh_CN.md
deleted file mode 100644
index 758964012daf1beb5afc9b64ecb8a2a3784a4cba..0000000000000000000000000000000000000000
--- a/components/antd/breadcrumb/README-zh_CN.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Breadcrumb
-
-Display the current location within a hierarchy. And allow going back to states higher up in the hierarchy. See [Ant Design](https://ant.design/components/breadcrumb/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/breadcrumb/README.md b/components/antd/breadcrumb/README.md
deleted file mode 100644
index 758964012daf1beb5afc9b64ecb8a2a3784a4cba..0000000000000000000000000000000000000000
--- a/components/antd/breadcrumb/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Breadcrumb
-
-Display the current location within a hierarchy. And allow going back to states higher up in the hierarchy. See [Ant Design](https://ant.design/components/breadcrumb/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/breadcrumb/app.py b/components/antd/breadcrumb/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/breadcrumb/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/breadcrumb/demos/basic.py b/components/antd/breadcrumb/demos/basic.py
deleted file mode 100644
index 1d12e1dd04742ae2b9547a0de3c902cc7ce6b8a8..0000000000000000000000000000000000000000
--- a/components/antd/breadcrumb/demos/basic.py
+++ /dev/null
@@ -1,44 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Breadcrumb():
- antd.Breadcrumb.Item(title="Ant Design")
- with antd.Breadcrumb.Item():
- with ms.Slot("title"):
- antd.Button(type="link", href="#")
- with antd.Breadcrumb.Item():
- with ms.Slot("title"):
- antd.Button(type="link", href="General")
- with ms.Slot("menu.items"):
- with antd.Menu.Item(key="1"):
- with ms.Slot("label"):
- antd.Button(
- "General",
- type="link",
- href="https://modelscope.cn",
- href_target="_blank",
- )
- with antd.Menu.Item(key="2"):
- with ms.Slot("label"):
- antd.Button(
- "Layout",
- type="link",
- href="https://ant.design/",
- href_target="_blank",
- )
- with antd.Menu.Item(key="3"):
- with ms.Slot("label"):
- antd.Button(
- "Navigation",
- type="link",
- href="https://www.alipay.com/",
- href_target="_blank",
- )
- antd.Breadcrumb.Item(title="Button")
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/button/README-zh_CN.md b/components/antd/button/README-zh_CN.md
deleted file mode 100644
index 065a07954b529c1cab2eef045b42e6855863e738..0000000000000000000000000000000000000000
--- a/components/antd/button/README-zh_CN.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Button
-
-To trigger an operation. See [Ant Design](https://ant.design/components/button/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/button/README.md b/components/antd/button/README.md
deleted file mode 100644
index 065a07954b529c1cab2eef045b42e6855863e738..0000000000000000000000000000000000000000
--- a/components/antd/button/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Button
-
-To trigger an operation. See [Ant Design](https://ant.design/components/button/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/button/app.py b/components/antd/button/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/button/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/button/demos/basic.py b/components/antd/button/demos/basic.py
deleted file mode 100644
index 7e234fa09a14127eeef7a07c9c6faf82204c6206..0000000000000000000000000000000000000000
--- a/components/antd/button/demos/basic.py
+++ /dev/null
@@ -1,25 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Flex(gap="small", wrap=True):
- btn = antd.Button("Primary Button", type="primary")
- btn.click(lambda: print("clicked"))
- with antd.Button():
- ms.Text("Default Button")
- antd.Button("Dashed Button", type="dashed")
- antd.Button("Text Button", type="text")
- antd.Button("Link Button", type="link")
- antd.Button("Filled", color="default", variant="filled")
- antd.Button("Filled", color="danger", variant="filled")
- with antd.Button(type="primary", loading=True):
- ms.Text("Loading")
- with ms.Slot("icon"):
- antd.Icon("PoweroffOutlined")
- antd.Button("Block", type="primary", block=True)
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/calendar/README-zh_CN.md b/components/antd/calendar/README-zh_CN.md
deleted file mode 100644
index f0d4339909067522ccafc3f5127093ef87f155ed..0000000000000000000000000000000000000000
--- a/components/antd/calendar/README-zh_CN.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# Calendar
-
-A container that displays data in calendar form. See [Ant Design](https://ant.design/components/calendar/) for more information.
-
-## Examples
-
-
-
diff --git a/components/antd/calendar/README.md b/components/antd/calendar/README.md
deleted file mode 100644
index f0d4339909067522ccafc3f5127093ef87f155ed..0000000000000000000000000000000000000000
--- a/components/antd/calendar/README.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# Calendar
-
-A container that displays data in calendar form. See [Ant Design](https://ant.design/components/calendar/) for more information.
-
-## Examples
-
-
-
diff --git a/components/antd/calendar/app.py b/components/antd/calendar/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/calendar/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/calendar/demos/basic.py b/components/antd/calendar/demos/basic.py
deleted file mode 100644
index ddd3da0e322d07ea3bf15c46c84781892d623184..0000000000000000000000000000000000000000
--- a/components/antd/calendar/demos/basic.py
+++ /dev/null
@@ -1,14 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- antd.Calendar()
- antd.Divider("Card")
- with antd.Card():
- antd.Calendar(fullscreen=False)
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/calendar/demos/notice_calendar.py b/components/antd/calendar/demos/notice_calendar.py
deleted file mode 100644
index 404aaeb470605fd4d979a657a21d4a2bc50fe210..0000000000000000000000000000000000000000
--- a/components/antd/calendar/demos/notice_calendar.py
+++ /dev/null
@@ -1,55 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- antd.Calendar(cell_render="""(current, info) => {
- if (info.type === 'date') {
- if (current.date() === 8) {
- const React = window.ms_globals.React;
- const antd = window.ms_globals.antd;
- const events = [
- {
- type: 'warning',
- content: 'This is warning event.',
- },
- {
- type: 'success',
- content: 'This is usual event.',
- },
- ];
- return React.createElement(
- 'ul',
- {
- style: {
- margin: 0,
- padding: 0,
- listStyle: 'none'
- }
- },
- events.map((event) => {
- return React.createElement(
- 'li',
- {
- style: {
- marginBottom: 8,
- },
- },
- [
- React.createElement(antd.Badge, {
- status: event.type,
- text: event.content,
- }),
- ]
- );
- })
- );
- }
- }
- return info.originNode;
-}""")
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/card/README-zh_CN.md b/components/antd/card/README-zh_CN.md
deleted file mode 100644
index 7ec12ede832fefda3f643db62da23be44f0be07f..0000000000000000000000000000000000000000
--- a/components/antd/card/README-zh_CN.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# Card
-
-A container for displaying information. See [Ant Design](https://ant.design/components/card/) for more information.
-
-## Examples
-
-
-
-
diff --git a/components/antd/card/README.md b/components/antd/card/README.md
deleted file mode 100644
index 7ec12ede832fefda3f643db62da23be44f0be07f..0000000000000000000000000000000000000000
--- a/components/antd/card/README.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# Card
-
-A container for displaying information. See [Ant Design](https://ant.design/components/card/) for more information.
-
-## Examples
-
-
-
-
diff --git a/components/antd/card/app.py b/components/antd/card/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/card/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/card/demos/basic.py b/components/antd/card/demos/basic.py
deleted file mode 100644
index a7d03841a5d5e95f0564f5807379d23f226d36f4..0000000000000000000000000000000000000000
--- a/components/antd/card/demos/basic.py
+++ /dev/null
@@ -1,27 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Space(direction="vertical", size=16):
- with antd.Card(title="Default size card",
- elem_style=dict(width=300)):
- with ms.Slot("extra"):
- antd.Button("More", type="link", href="#")
- ms.Div("Card content")
- ms.Div("Card content")
- ms.Div("Card content")
- with antd.Card(title="Small size card",
- elem_style=dict(width=300),
- size="small",
- bordered=False):
- with ms.Slot("extra"):
- antd.Button("More", type="link", href="#")
- ms.Div("Card content")
- ms.Div("Card content")
- ms.Div("Card content")
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/card/demos/customized_content.py b/components/antd/card/demos/customized_content.py
deleted file mode 100644
index ef94c82877653354b25a90733bb5dabb6558dfaf..0000000000000000000000000000000000000000
--- a/components/antd/card/demos/customized_content.py
+++ /dev/null
@@ -1,39 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Space(direction="vertical", size=16):
- with antd.Card(hoverable=True, elem_style=dict(width=240)):
- with ms.Slot("cover"):
- antd.Image(
- value=
- "https://os.alipayobjects.com/rmsportal/QBnOOoLaAfKPirc.png",
- width="100%",
- preview=False,
- alt="example")
- antd.Card.Meta(title="Europe Street beat",
- description="www.instagram.com")
- with antd.Card(elem_style=dict(width=300)):
- with ms.Slot("cover"):
- antd.Image(
- value=
- "https://gw.alipayobjects.com/zos/rmsportal/JiqGstEfoWAOHiTxclqi.png",
- preview=False,
- width="100%",
- alt="example")
- with ms.Slot("actions"):
- antd.Icon("SettingOutlined")
- antd.Icon("EditOutlined")
- antd.Icon("EllipsisOutlined")
- with antd.Card.Meta(title="Card title",
- description="This is the description"):
- with ms.Slot("avatar"):
- antd.Avatar(
- "https://api.dicebear.com/7.x/miniavs/svg?seed=8"
- )
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/card/demos/grid_card.py b/components/antd/card/demos/grid_card.py
deleted file mode 100644
index 6f70df2ef3efb68d7bd7fe6b9839876b1878866c..0000000000000000000000000000000000000000
--- a/components/antd/card/demos/grid_card.py
+++ /dev/null
@@ -1,30 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-gridStyle = {
- "width": '25%',
- "textAlign": 'center',
-}
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Card(title="Card Title"):
- with antd.Card.Grid(elem_style=gridStyle):
- ms.Text("Content")
- with antd.Card.Grid(hoverable=False, elem_style=gridStyle):
- ms.Text("Content")
- with antd.Card.Grid(elem_style=gridStyle):
- ms.Text("Content")
- with antd.Card.Grid(elem_style=gridStyle):
- ms.Text("Content")
- with antd.Card.Grid(elem_style=gridStyle):
- ms.Text("Content")
- with antd.Card.Grid(elem_style=gridStyle):
- ms.Text("Content")
- with antd.Card.Grid(elem_style=gridStyle):
- ms.Text("Content")
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/carousel/README-zh_CN.md b/components/antd/carousel/README-zh_CN.md
deleted file mode 100644
index 37e7e46987f37d6f406094e29a595383bd8b167b..0000000000000000000000000000000000000000
--- a/components/antd/carousel/README-zh_CN.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Carousel
-
-A set of carousel areas. See [Ant Design](https://ant.design/components/carousel/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/carousel/README.md b/components/antd/carousel/README.md
deleted file mode 100644
index 37e7e46987f37d6f406094e29a595383bd8b167b..0000000000000000000000000000000000000000
--- a/components/antd/carousel/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Carousel
-
-A set of carousel areas. See [Ant Design](https://ant.design/components/carousel/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/carousel/app.py b/components/antd/carousel/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/carousel/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/carousel/demos/basic.py b/components/antd/carousel/demos/basic.py
deleted file mode 100644
index f167aaa2f8eceab3ed40c649377ab1d641862a75..0000000000000000000000000000000000000000
--- a/components/antd/carousel/demos/basic.py
+++ /dev/null
@@ -1,73 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-default_dot_position = 'bottom'
-default_auto_play = True
-default_show_arrows = True
-
-content_style = {
- "margin": 0,
- "height": '160px',
- "color": '#fff',
- "lineHeight": '160px',
- "textAlign": 'center',
- "background": '#364d79',
-}
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Space():
- dot_position = antd.RadioGroup(value=default_dot_position,
- option_type="button",
- options=[{
- "label": "Top",
- "value": "top"
- }, {
- "label": "Bottom",
- "value": "bottom"
- }, {
- "label": "Left",
- "value": "left"
- }, {
- "label": "Right",
- "value": "right"
- }])
- auto_play = antd.Switch(value=default_auto_play,
- checked_children="AutoPlay",
- un_checked_children="No AutoPlay")
- show_arrows = antd.Switch(value=default_show_arrows,
- checked_children="Show Arrows",
- un_checked_children="Hide Arrows")
- with antd.Carousel(dot_position=default_dot_position,
- autoplay=default_auto_play,
- arrows=default_show_arrows) as carousel:
- with ms.Div():
- antd.Typography.Title("1",
- level=3,
- elem_style=content_style)
- with ms.Div():
- antd.Typography.Title("2",
- level=3,
- elem_style=content_style)
- with ms.Div():
- antd.Typography.Title("3",
- level=3,
- elem_style=content_style)
- with ms.Div():
- antd.Typography.Title("4",
- level=3,
- elem_style=content_style)
-
- auto_play.change(fn=lambda x: gr.update(autoplay=x),
- inputs=[auto_play],
- outputs=[carousel])
- show_arrows.change(fn=lambda x: gr.update(arrows=x),
- inputs=[show_arrows],
- outputs=[carousel])
- dot_position.change(fn=lambda x: gr.update(dot_position=x),
- inputs=[dot_position],
- outputs=[carousel])
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/cascader/README-zh_CN.md b/components/antd/cascader/README-zh_CN.md
deleted file mode 100644
index e46238825a667706e8a93996ed5aef5f1be1065a..0000000000000000000000000000000000000000
--- a/components/antd/cascader/README-zh_CN.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# Cascader
-
-Cascade selection box. See [Ant Design](https://ant.design/components/cascader/) for more information.
-
-## Examples
-
-
-
diff --git a/components/antd/cascader/README.md b/components/antd/cascader/README.md
deleted file mode 100644
index e46238825a667706e8a93996ed5aef5f1be1065a..0000000000000000000000000000000000000000
--- a/components/antd/cascader/README.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# Cascader
-
-Cascade selection box. See [Ant Design](https://ant.design/components/cascader/) for more information.
-
-## Examples
-
-
-
diff --git a/components/antd/cascader/app.py b/components/antd/cascader/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/cascader/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/cascader/demos/basic.py b/components/antd/cascader/demos/basic.py
deleted file mode 100644
index 21b4147d318f81b7a3ee59b363e4a1b79dab5e7f..0000000000000000000000000000000000000000
--- a/components/antd/cascader/demos/basic.py
+++ /dev/null
@@ -1,47 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- antd.Cascader(elem_style=dict(width=300),
- options=[{
- "value":
- 'zhejiang',
- "label":
- 'Zhejiang',
- "children": [{
- "value": 'hangzhou',
- "label": 'Hangzhou'
- }],
- }, {
- "value":
- 'jiangsu',
- "label":
- 'Jiangsu',
- "children": [{
- "value": 'nanjing',
- "label": 'Nanjing'
- }],
- }, {
- "value": 'shanghai',
- "label": 'Shanghai',
- "disabled": True
- }])
- antd.Divider("Multiple")
- with antd.Cascader(elem_style=dict(width='100%'),
- multiple=True,
- max_tag_count="responsive"):
- antd.Cascader.Option(label="Light", value="light")
- with antd.Cascader.Option(label="Bamboo", value="bamboo"):
- with antd.Cascader.Option(label="Little", value="little"):
- antd.Cascader.Option(label="Toy Fish",
- value="fish",
- disabled=True)
- antd.Cascader.Option(label="Toy Bird", value="bird")
- with antd.Cascader.Option(value="cat"):
- with ms.Slot("label"):
- antd.Typography.Text("Toy Cat", type="success")
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/cascader/demos/panel.py b/components/antd/cascader/demos/panel.py
deleted file mode 100644
index c173916bb21059c4d0b7c94319f15cfee38c632f..0000000000000000000000000000000000000000
--- a/components/antd/cascader/demos/panel.py
+++ /dev/null
@@ -1,31 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- antd.Cascader.Panel(options=[
- {
- "value": 'zhejiang',
- "label": 'Zhejiang',
- "children": [{
- "value": 'hangzhou',
- "label": 'Hangzhou'
- }],
- }, {
- "value": 'jiangsu',
- "label": 'Jiangsu',
- "children": [{
- "value": 'nanjing',
- "label": 'Nanjing'
- }],
- }, {
- "value": 'shanghai',
- "label": 'Shanghai',
- "disabled": True
- }
- ])
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/checkbox/README-zh_CN.md b/components/antd/checkbox/README-zh_CN.md
deleted file mode 100644
index 868114d6d00745117f84c5f3e08c2b8928b87868..0000000000000000000000000000000000000000
--- a/components/antd/checkbox/README-zh_CN.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Checkbox
-
-Collect user's choices. See [Ant Design](https://ant.design/components/checkbox/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/checkbox/README.md b/components/antd/checkbox/README.md
deleted file mode 100644
index 868114d6d00745117f84c5f3e08c2b8928b87868..0000000000000000000000000000000000000000
--- a/components/antd/checkbox/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Checkbox
-
-Collect user's choices. See [Ant Design](https://ant.design/components/checkbox/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/checkbox/app.py b/components/antd/checkbox/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/checkbox/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/checkbox/demos/basic.py b/components/antd/checkbox/demos/basic.py
deleted file mode 100644
index 9482e480b666e7c64957b3ac94b4091999ec6937..0000000000000000000000000000000000000000
--- a/components/antd/checkbox/demos/basic.py
+++ /dev/null
@@ -1,37 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Checkbox():
- ms.Text("Checkbox")
- antd.Divider("Checkbox Group")
- with antd.Space(direction="vertical"):
- antd.Checkbox.Group(value=["Apple"],
- options=[
- {
- "label": 'Apple',
- "value": 'Apple'
- },
- {
- "label": 'Pear',
- "value": 'Pear'
- },
- {
- "label": 'Orange',
- "value": 'Orange',
- "disabled": True
- },
- ])
- with antd.Checkbox.Group(value=["Pear", "Apple"]):
- with antd.Checkbox.Group.Option(value="Apple"):
- with ms.Slot("label"):
- antd.Typography.Text("Apple", type="success")
- antd.Checkbox.Group.Option(value="Pear", label="Pear")
- antd.Checkbox.Group.Option(value="Orange",
- disabled=True,
- label="Orange")
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/collapse/README-zh_CN.md b/components/antd/collapse/README-zh_CN.md
deleted file mode 100644
index 6ece78040f42185a93d13119d7d75ee4094f5b9a..0000000000000000000000000000000000000000
--- a/components/antd/collapse/README-zh_CN.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# Collapse
-
-A content area which can be collapsed and expanded.
-See [Ant Design](https://ant.design/components/collapse/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/collapse/README.md b/components/antd/collapse/README.md
deleted file mode 100644
index 6ece78040f42185a93d13119d7d75ee4094f5b9a..0000000000000000000000000000000000000000
--- a/components/antd/collapse/README.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# Collapse
-
-A content area which can be collapsed and expanded.
-See [Ant Design](https://ant.design/components/collapse/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/collapse/app.py b/components/antd/collapse/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/collapse/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/collapse/demos/basic.py b/components/antd/collapse/demos/basic.py
deleted file mode 100644
index 92d237419595b6139b9718a6afc48f22f8261fe1..0000000000000000000000000000000000000000
--- a/components/antd/collapse/demos/basic.py
+++ /dev/null
@@ -1,41 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-default_accordion = False
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- accordion = antd.Switch(value=default_accordion,
- checked_children="Accordion",
- un_checked_children="Collapse")
- with antd.Collapse(default_active_key=['2'],
- accordion=default_accordion) as collapse:
- with antd.Collapse.Item(collapsible='disabled',
- key="1",
- label="This is panel header 1"):
- antd.Typography.Paragraph("""
- A dog is a type of domesticated animal.
- Known for its loyalty and faithfulness,
- it can be found as a welcome guest in many households across the world.
-""")
- with antd.Collapse.Item(label="This is panel header 2",
- key="2"):
- antd.Typography.Paragraph("""
- A dog is a type of domesticated animal.
- Known for its loyalty and faithfulness,
- it can be found as a welcome guest in many households across the world.
-""")
- with antd.Collapse.Item(label="This is panel header 3",
- key="3"):
- antd.Typography.Paragraph("""
- A dog is a type of domesticated animal.
- Known for its loyalty and faithfulness,
- it can be found as a welcome guest in many households across the world.
-""")
- accordion.change(fn=lambda x: gr.update(accordion=x),
- inputs=[accordion],
- outputs=[collapse])
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/color_picker/README-zh_CN.md b/components/antd/color_picker/README-zh_CN.md
deleted file mode 100644
index 6e2237ace60fcd7aa53f82cc9ce3c697af877aea..0000000000000000000000000000000000000000
--- a/components/antd/color_picker/README-zh_CN.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# ColorPicker
-
-Used for color selection. See [Ant Design](https://ant.design/components/color-picker/) for more information.
-
-## Examples
-
-
-
diff --git a/components/antd/color_picker/README.md b/components/antd/color_picker/README.md
deleted file mode 100644
index 6e2237ace60fcd7aa53f82cc9ce3c697af877aea..0000000000000000000000000000000000000000
--- a/components/antd/color_picker/README.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# ColorPicker
-
-Used for color selection. See [Ant Design](https://ant.design/components/color-picker/) for more information.
-
-## Examples
-
-
-
diff --git a/components/antd/color_picker/app.py b/components/antd/color_picker/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/color_picker/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/color_picker/demos/basic.py b/components/antd/color_picker/demos/basic.py
deleted file mode 100644
index e1a6df26bbeac1f7edeaec4363c0f09b7d64a87e..0000000000000000000000000000000000000000
--- a/components/antd/color_picker/demos/basic.py
+++ /dev/null
@@ -1,25 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Space():
- antd.ColorPicker(value="#816DF8")
- antd.ColorPicker(value="#816DF8", show_text=True)
- antd.ColorPicker(value=[
- {
- "color": 'rgb(16, 142, 233)',
- "percent": 0,
- },
- {
- "color": 'rgb(135, 208, 104)',
- "percent": 100,
- },
- ],
- show_text=True,
- allow_clear=True,
- mode="gradient")
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/color_picker/demos/preset.py b/components/antd/color_picker/demos/preset.py
deleted file mode 100644
index aa35871f3acf8f41cc691ac003a51d62bd720c6e..0000000000000000000000000000000000000000
--- a/components/antd/color_picker/demos/preset.py
+++ /dev/null
@@ -1,55 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Space():
- antd.ColorPicker(value="#816DF8",
- presets=[{
- "label":
- "primary",
- "colors": [
- "#e6f4ff", "#bae0ff", "#91caff",
- "#69b1ff", "#4096ff", "#1677ff",
- "#0958d9", "#003eb3", "#002c8c",
- "#001d66"
- ]
- }, {
- "label":
- "red",
- "colors": [
- "#fff1f0", "#ffccc7", "#ffa39e",
- "#ff7875", "#ff4d4f", "#f5222d",
- "#cf1322", "#a8071a", "#820014",
- "#5c0011"
- ]
- }, {
- "label":
- "green",
- "colors": [
- "#f6ffed", "#d9f7be", "#b7eb8f",
- "#95de64", "#73d13d", "#52c41a",
- "#389e0d", "#237804", "#135200",
- "#092b00"
- ]
- }])
- with antd.ColorPicker(value="#816DF8"):
- with ms.Slot("presets"):
- with antd.ColorPicker.Preset(colors=[
- "#e6f4ff", "#bae0ff", "#91caff", "#69b1ff",
- "#4096ff", "#1677ff", "#0958d9", "#003eb3",
- "#002c8c", "#001d66"
- ]):
- with ms.Slot("label"):
- antd.Typography.Text("Primary", type="success")
- antd.ColorPicker.Preset(colors=[
- "#fff1f0", "#ffccc7", "#ffa39e", "#ff7875",
- "#ff4d4f", "#f5222d", "#cf1322", "#a8071a",
- "#820014", "#5c0011"
- ],
- label="red")
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/config_provider/README-zh_CN.md b/components/antd/config_provider/README-zh_CN.md
deleted file mode 100644
index 11813c29136f50f8e2bd8491b203730d706086c1..0000000000000000000000000000000000000000
--- a/components/antd/config_provider/README-zh_CN.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# ConfigProvider
-
-Provide a uniform configuration support for components. See [Ant Design](https://ant.design/components/config-provider/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/config_provider/README.md b/components/antd/config_provider/README.md
deleted file mode 100644
index 11813c29136f50f8e2bd8491b203730d706086c1..0000000000000000000000000000000000000000
--- a/components/antd/config_provider/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# ConfigProvider
-
-Provide a uniform configuration support for components. See [Ant Design](https://ant.design/components/config-provider/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/config_provider/app.py b/components/antd/config_provider/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/config_provider/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/config_provider/demos/basic.py b/components/antd/config_provider/demos/basic.py
deleted file mode 100644
index 58b16056704eb4176fe31cafcd27b6b4c835e1ea..0000000000000000000000000000000000000000
--- a/components/antd/config_provider/demos/basic.py
+++ /dev/null
@@ -1,74 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-default_locale = "en_US"
-default_direction = 'ltr'
-default_color = "#816DF8"
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider(
- locale=default_locale,
- direction=default_direction,
- theme=dict(token=dict(
- colorPrimary=default_color))) as config_provider:
- with antd.Card():
- with ms.Div(elem_style=dict(marginBottom=16)):
- ms.Span("change locale of components:",
- elem_style=dict(marginInlineEnd=16))
- with antd.Radio.Group(value=default_locale) as locale:
- with antd.Radio("en_US"):
- ms.Text("English")
- with antd.Radio("zh_CN"):
- ms.Text("中文")
- with antd.Radio("ja_JP"):
- ms.Text("日本語")
- with antd.Radio("ko_KR"):
- ms.Text("한국어")
- with antd.Space(wrap=True):
- antd.DatePicker()
- antd.DatePicker.RangePicker()
- antd.TimePicker()
- antd.TimePicker.RangePicker()
- with ms.Div(elem_style=dict(marginBottom=16)):
- ms.Span("change direction of components:",
- elem_style=dict(marginInlineEnd=16))
- with antd.Radio.Group(
- value=default_direction) as direction:
- with antd.Radio.Button("ltr"):
- ms.Text("LTR")
- with antd.Radio.Button("rtl"):
- ms.Text("RTL")
- antd.Input(placeholder="do something...")
- with ms.Div(elem_style=dict(marginBottom=16)):
- ms.Span("change theme of components:",
- elem_style=dict(marginInlineEnd=16))
- with antd.Space():
- with antd.Checkbox.Group() as theme:
- antd.Checkbox.Group.Option("dark", label="dark")
- antd.Checkbox.Group.Option("compact",
- label="compact")
- ms.Text("Primary Color: ")
- color = antd.ColorPicker(value=default_color)
-
- antd.Button("Primary Button", type="primary", block=True)
-
- locale.change(fn=lambda _locale: gr.update(locale=_locale),
- inputs=[locale],
- outputs=[config_provider])
- direction.change(fn=lambda _direction: gr.update(direction=_direction),
- inputs=[direction],
- outputs=[config_provider])
- gr.on(
- [theme.change, color.change],
- fn=lambda _theme, _color: gr.update(theme=dict(
- token=dict(colorPrimary=_color) if _color else None,
- algorithm=dict(dark=True
- if _theme and 'dark' in _theme else False,
- compact=True
- if _theme and 'compact' in _theme else False))),
- inputs=[theme, color],
- outputs=[config_provider])
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/date_picker/README-zh_CN.md b/components/antd/date_picker/README-zh_CN.md
deleted file mode 100644
index 5ebb9a90bb6c204c98570d153768280f255400cd..0000000000000000000000000000000000000000
--- a/components/antd/date_picker/README-zh_CN.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# DatePicker
-
-To select or input a date. See [Ant Design](https://ant.design/components/date-picker/) for more information.
-
-## Examples
-
-
-
diff --git a/components/antd/date_picker/README.md b/components/antd/date_picker/README.md
deleted file mode 100644
index 5ebb9a90bb6c204c98570d153768280f255400cd..0000000000000000000000000000000000000000
--- a/components/antd/date_picker/README.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# DatePicker
-
-To select or input a date. See [Ant Design](https://ant.design/components/date-picker/) for more information.
-
-## Examples
-
-
-
diff --git a/components/antd/date_picker/app.py b/components/antd/date_picker/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/date_picker/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/date_picker/demos/basic.py b/components/antd/date_picker/demos/basic.py
deleted file mode 100644
index 0e1f93b6b55d73b337a8d937f85dc633c8fa0d58..0000000000000000000000000000000000000000
--- a/components/antd/date_picker/demos/basic.py
+++ /dev/null
@@ -1,35 +0,0 @@
-import time
-
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Space(direction="vertical"):
- antd.DatePicker()
- antd.DatePicker(picker="week")
- antd.DatePicker(picker="month")
- antd.DatePicker(picker="quarter")
- antd.DatePicker(picker="year")
- antd.Divider("Preset Date")
- antd.DatePicker(
- need_confirm=True,
- presets=[
- {
- "label": 'Yesterday',
- # Python 的 timestamp
- "value": time.time() - 86400
- },
- {
- "label": 'Last 7 Days',
- "value": time.time() - 86400 * 7
- },
- {
- "label": 'Last 30 Days',
- "value": time.time() - 86400 * 30
- }
- ])
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/date_picker/demos/range_picker.py b/components/antd/date_picker/demos/range_picker.py
deleted file mode 100644
index fd05a2d008ffe8ae354064282d5ea9c4e4f1c535..0000000000000000000000000000000000000000
--- a/components/antd/date_picker/demos/range_picker.py
+++ /dev/null
@@ -1,16 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Space(direction="vertical"):
- antd.DatePicker.RangePicker()
- antd.DatePicker.RangePicker(show_time=True)
- antd.DatePicker.RangePicker(picker="week")
- antd.DatePicker.RangePicker(picker="month")
- antd.DatePicker.RangePicker(picker="quarter")
- antd.DatePicker.RangePicker(picker="year")
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/descriptions/README-zh_CN.md b/components/antd/descriptions/README-zh_CN.md
deleted file mode 100644
index c69b1d669d4cc864eaf737fec4c3edf66cdb539a..0000000000000000000000000000000000000000
--- a/components/antd/descriptions/README-zh_CN.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# Descriptions
-
-Display multiple read-only fields in a group.
-See [Ant Design](https://ant.design/components/descriptions/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/descriptions/README.md b/components/antd/descriptions/README.md
deleted file mode 100644
index c69b1d669d4cc864eaf737fec4c3edf66cdb539a..0000000000000000000000000000000000000000
--- a/components/antd/descriptions/README.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# Descriptions
-
-Display multiple read-only fields in a group.
-See [Ant Design](https://ant.design/components/descriptions/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/descriptions/app.py b/components/antd/descriptions/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/descriptions/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/descriptions/demos/basic.py b/components/antd/descriptions/demos/basic.py
deleted file mode 100644
index 60885836679e0b7ab783058e8984f66d9fc33fba..0000000000000000000000000000000000000000
--- a/components/antd/descriptions/demos/basic.py
+++ /dev/null
@@ -1,58 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-default_bordered = False
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- bordered = antd.Switch(value=default_bordered,
- checked_children="Border",
- un_checked_children="No Border")
- with antd.Descriptions(title="User Info",
- bordered=default_bordered) as descriptions:
- with antd.Descriptions.Item(label="Product"):
- ms.Text("Cloud Database")
- with antd.Descriptions.Item(label="Billing Mode"):
- ms.Text("Prepaid")
-
- with antd.Descriptions.Item(label="Automatic Renewal"):
- ms.Text("YES")
-
- with antd.Descriptions.Item(label="Order time"):
- ms.Text("2018-04-24 18:00:00")
-
- with antd.Descriptions.Item(label="Usage Time", span=2):
- ms.Text("2019-04-24 18:00:00")
-
- with antd.Descriptions.Item(label="Status", span=3):
- antd.Badge(status="processing", text="Running")
-
- with antd.Descriptions.Item(label="Negotiated Amount"):
- ms.Text("$80.00")
-
- with antd.Descriptions.Item(label="Discount"):
- ms.Text("$20.00")
-
- with antd.Descriptions.Item(label="Official Receipts"):
- ms.Text("$60.00")
-
- with antd.Descriptions.Item(label="Config Info"):
- gr.HTML("""Data disk type: MongoDB
-
-Database version: 3.4
-
-Package: dds.mongo.mid
-
-Storage space: 10 GB
-
-Replication factor: 3
-
-Region: East China 1
- """)
- bordered.change(fn=lambda x: gr.update(bordered=x),
- inputs=[bordered],
- outputs=[descriptions])
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/divider/README-zh_CN.md b/components/antd/divider/README-zh_CN.md
deleted file mode 100644
index 36464d048d8b0c0083db1bf738888fc56a492c36..0000000000000000000000000000000000000000
--- a/components/antd/divider/README-zh_CN.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Divider
-
-A divider line separates different content. See [Ant Design](https://ant.design/components/divider/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/divider/README.md b/components/antd/divider/README.md
deleted file mode 100644
index 36464d048d8b0c0083db1bf738888fc56a492c36..0000000000000000000000000000000000000000
--- a/components/antd/divider/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Divider
-
-A divider line separates different content. See [Ant Design](https://ant.design/components/divider/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/divider/app.py b/components/antd/divider/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/divider/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/divider/demos/basic.py b/components/antd/divider/demos/basic.py
deleted file mode 100644
index 5bc02586ed05d492f8dd2060107ad67bd8bbf414..0000000000000000000000000000000000000000
--- a/components/antd/divider/demos/basic.py
+++ /dev/null
@@ -1,28 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- ms.Div(
- " Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi istaprobare, quae sunt a te dicta? Refert tamen, quo modo."
- )
- antd.Divider("Solid", elem_style=dict(borderColor='#7cb305'))
- ms.Div(
- " Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi istaprobare, quae sunt a te dicta? Refert tamen, quo modo."
- )
- with antd.Divider(elem_style=dict(borderColor='#7cb305'),
- variant="dotted"):
- ms.Text("Dotted")
- ms.Div(
- " Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi istaprobare, quae sunt a te dicta? Refert tamen, quo modo."
- )
- with antd.Divider(elem_style=dict(borderColor='#7cb305'),
- variant="dashed"):
- ms.Text("Dashed")
- ms.Div(
- " Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi istaprobare, quae sunt a te dicta? Refert tamen, quo modo."
- )
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/drawer/README-zh_CN.md b/components/antd/drawer/README-zh_CN.md
deleted file mode 100644
index 9db674ce48ef54759419c5f2c380dc7d0ab1ddcb..0000000000000000000000000000000000000000
--- a/components/antd/drawer/README-zh_CN.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# Drawer
-
-A panel that slides out from the edge of the screen. See [Ant Design](https://ant.design/components/drawer/) for more information.
-
-## Examples
-
-
-
diff --git a/components/antd/drawer/README.md b/components/antd/drawer/README.md
deleted file mode 100644
index 9db674ce48ef54759419c5f2c380dc7d0ab1ddcb..0000000000000000000000000000000000000000
--- a/components/antd/drawer/README.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# Drawer
-
-A panel that slides out from the edge of the screen. See [Ant Design](https://ant.design/components/drawer/) for more information.
-
-## Examples
-
-
-
diff --git a/components/antd/drawer/app.py b/components/antd/drawer/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/drawer/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/drawer/demos/basic.py b/components/antd/drawer/demos/basic.py
deleted file mode 100644
index 5047a39347419baf609b88bdfbe9d51d06ad2b5e..0000000000000000000000000000000000000000
--- a/components/antd/drawer/demos/basic.py
+++ /dev/null
@@ -1,18 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- btn = antd.Button("Open Drawer", type="primary")
- with antd.Drawer(open=False, title="Basic Drawer") as drawer:
- antd.Typography.Paragraph("Some contents...")
- antd.Typography.Paragraph("Some contents...")
- antd.Typography.Paragraph("Some contents...")
- btn.click(fn=lambda: gr.update(open=True), outputs=[drawer])
-
- drawer.close(fn=lambda: gr.update(open=False), outputs=[drawer])
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/drawer/demos/extra_actions.py b/components/antd/drawer/demos/extra_actions.py
deleted file mode 100644
index 9b32e21dcf4cfb9a439a721c99cbb614447c3472..0000000000000000000000000000000000000000
--- a/components/antd/drawer/demos/extra_actions.py
+++ /dev/null
@@ -1,35 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-default_placement = 'right'
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Space():
- placement = antd.RadioGroup(
- options=["top", "bottom", "left", "right"],
- value=default_placement)
- btn = antd.Button("Open Drawer", type="primary")
- with antd.Drawer(open=False,
- title="Drawer with extra actions",
- width=500) as drawer:
- with ms.Slot("extra"):
- with antd.Space():
- cancel_btn = antd.Button("Cancel")
- ok_btn = antd.Button("OK", type="primary")
- antd.Typography.Paragraph("Some contents...")
- antd.Typography.Paragraph("Some contents...")
- antd.Typography.Paragraph("Some contents...")
- placement.change(fn=lambda p: gr.update(placement=p),
- inputs=[placement],
- outputs=[drawer])
- btn.click(fn=lambda: gr.update(open=True), outputs=[drawer])
-
- gr.on([drawer.close, ok_btn.click, cancel_btn.click],
- fn=lambda: gr.update(open=False),
- outputs=[drawer])
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/dropdown/README-zh_CN.md b/components/antd/dropdown/README-zh_CN.md
deleted file mode 100644
index cc35de09d270714aae94d1ab4814168e3c417ada..0000000000000000000000000000000000000000
--- a/components/antd/dropdown/README-zh_CN.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Dropdown
-
-A dropdown list. See [Ant Design](https://ant.design/components/dropdown/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/dropdown/README.md b/components/antd/dropdown/README.md
deleted file mode 100644
index cc35de09d270714aae94d1ab4814168e3c417ada..0000000000000000000000000000000000000000
--- a/components/antd/dropdown/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Dropdown
-
-A dropdown list. See [Ant Design](https://ant.design/components/dropdown/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/dropdown/app.py b/components/antd/dropdown/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/dropdown/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/dropdown/demos/basic.py b/components/antd/dropdown/demos/basic.py
deleted file mode 100644
index 43fe67cc505ecea2d5a1aa78b4bb83949a6a274a..0000000000000000000000000000000000000000
--- a/components/antd/dropdown/demos/basic.py
+++ /dev/null
@@ -1,50 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-
-def Menu():
- with antd.Menu.Item(key="1"):
- with ms.Slot("label"):
- antd.Button(
- "General",
- type="link",
- href="https://modelscope.cn",
- href_target="_blank",
- )
- with antd.Menu.Item(key="2"):
- with ms.Slot("label"):
- antd.Button(
- "Layout",
- type="link",
- href="https://ant.design/",
- href_target="_blank",
- )
- with antd.Menu.Item(key="3"):
- with ms.Slot("label"):
- antd.Button(
- "Navigation",
- type="link",
- href="https://www.alipay.com/",
- href_target="_blank",
- )
-
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Space():
- with antd.Dropdown():
- with antd.Button(type="text"):
- with antd.Space():
- ms.Text("Hover me")
- antd.Icon("DownOutlined")
- with ms.Slot("menu.items"):
- Menu()
- with antd.Dropdown.Button(danger=True):
- ms.Text("Danger")
- with ms.Slot("menu.items"):
- Menu()
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/empty/README-zh_CN.md b/components/antd/empty/README-zh_CN.md
deleted file mode 100644
index a15150d712deb03f93d55e5c04f16e2b9fd2c6fa..0000000000000000000000000000000000000000
--- a/components/antd/empty/README-zh_CN.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Empty
-
-Empty state placeholder. See [Ant Design](https://ant.design/components/empty/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/empty/README.md b/components/antd/empty/README.md
deleted file mode 100644
index a15150d712deb03f93d55e5c04f16e2b9fd2c6fa..0000000000000000000000000000000000000000
--- a/components/antd/empty/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Empty
-
-Empty state placeholder. See [Ant Design](https://ant.design/components/empty/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/empty/app.py b/components/antd/empty/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/empty/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/empty/demos/basic.py b/components/antd/empty/demos/basic.py
deleted file mode 100644
index cbcf58e049ccab198d614f6387de12d2a999e398..0000000000000000000000000000000000000000
--- a/components/antd/empty/demos/basic.py
+++ /dev/null
@@ -1,24 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-default_bordered = False
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Space(direction="vertical"):
- antd.Empty()
- antd.Empty(description=False)
- antd.Empty(image="PRESENTED_IMAGE_SIMPLE")
- with antd.Empty(
- image=
- "https://gw.alipayobjects.com/zos/antfincdn/ZHrcdLPrvN/empty.svg",
- image_style=dict(height=60)):
- with ms.Slot("description"):
- with antd.Typography.Text():
- ms.Text("Customize")
- antd.Button('Description', type="link", href="#")
- antd.Button("Create Now", type="primary")
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/flex/README-zh_CN.md b/components/antd/flex/README-zh_CN.md
deleted file mode 100644
index 2e21bfddd02e88a5e14c305d3038fefcd2599437..0000000000000000000000000000000000000000
--- a/components/antd/flex/README-zh_CN.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# Flex
-
-A flex layout container for alignment. See [Ant Design](https://ant.design/components/flex/) for more information.
-
-## Examples
-
-
-
diff --git a/components/antd/flex/README.md b/components/antd/flex/README.md
deleted file mode 100644
index 2e21bfddd02e88a5e14c305d3038fefcd2599437..0000000000000000000000000000000000000000
--- a/components/antd/flex/README.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# Flex
-
-A flex layout container for alignment. See [Ant Design](https://ant.design/components/flex/) for more information.
-
-## Examples
-
-
-
diff --git a/components/antd/flex/app.py b/components/antd/flex/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/flex/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/flex/demos/align.py b/components/antd/flex/demos/align.py
deleted file mode 100644
index 0d20a56ce3b8b6928c36cb00b10e13cf9009ca05..0000000000000000000000000000000000000000
--- a/components/antd/flex/demos/align.py
+++ /dev/null
@@ -1,44 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Flex(gap="middle", align="start", vertical=True):
- ms.Div("Select justify:")
- justify_segmented = antd.Segmented('flex-start',
- options=[
- 'flex-start',
- 'center',
- 'flex-end',
- 'space-between',
- 'space-around',
- 'space-evenly',
- ])
- ms.Div("Select align:")
- align_segmented = antd.Segmented(
- 'flex-start', options=['flex-start', 'center', 'flex-end'])
- with antd.Flex(elem_style=dict(
- width='100%',
- height=120,
- borderRadius=6,
- border='1px solid #40a9ff',
- ),
- justify="flex-start",
- align="flex-start") as flex:
- antd.Button("Primary", type="primary")
- antd.Button("Primary", type="primary")
- antd.Button("Primary", type="primary")
- antd.Button("Primary", type="primary")
- justify_segmented.change(fn=lambda _justify_segmented: gr.
- update(justify=_justify_segmented),
- inputs=[justify_segmented],
- outputs=[flex])
- align_segmented.change(fn=lambda _align_segmented: gr.update(
- align=_align_segmented),
- inputs=[align_segmented],
- outputs=[flex])
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/flex/demos/basic.py b/components/antd/flex/demos/basic.py
deleted file mode 100644
index 3b245f0492f3e5363e80523fd61fce2d8112d371..0000000000000000000000000000000000000000
--- a/components/antd/flex/demos/basic.py
+++ /dev/null
@@ -1,25 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Flex(gap="middle", vertical=True):
- with antd.Radio.Group("horizontal") as radio_group:
- with antd.Radio("horizontal"):
- ms.Text("horizontal")
- with antd.Radio("vertical"):
- ms.Text("vertical")
- with antd.Flex(vertical=False) as flex:
- for i in range(4):
- ms.Div(elem_style=dict(height=54,
- width="25%",
- backgroundColor='#1677ff' if i %
- 2 else '#1677ffbf'))
- radio_group.change(fn=lambda _radio_group: gr.update(
- vertical=True if _radio_group == "vertical" else False),
- inputs=[radio_group],
- outputs=[flex])
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/float_button/README-zh_CN.md b/components/antd/float_button/README-zh_CN.md
deleted file mode 100644
index 0c7d28f367a3096eb5a8afce28274d000463a29d..0000000000000000000000000000000000000000
--- a/components/antd/float_button/README-zh_CN.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# FloatButton
-
-A button that floats at the top of the page. See [Ant Design](https://ant.design/components/float-button/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/float_button/README.md b/components/antd/float_button/README.md
deleted file mode 100644
index 0c7d28f367a3096eb5a8afce28274d000463a29d..0000000000000000000000000000000000000000
--- a/components/antd/float_button/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# FloatButton
-
-A button that floats at the top of the page. See [Ant Design](https://ant.design/components/float-button/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/float_button/app.py b/components/antd/float_button/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/float_button/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/float_button/demos/basic.py b/components/antd/float_button/demos/basic.py
deleted file mode 100644
index 8fb2dceae275019a7499ac2b0c0e2eb877edf5df..0000000000000000000000000000000000000000
--- a/components/antd/float_button/demos/basic.py
+++ /dev/null
@@ -1,29 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.FloatButton.Group(shape="circle",
- elem_style=dict(insetInlineEnd=24)):
- with antd.FloatButton(badge=dict(count=12)):
- antd.Icon("QuestionCircleOutlined")
- antd.FloatButton(badge=dict(count=123, overflowCount=999))
- antd.FloatButton.BackTop(visibility_height=0)
-
- antd.FloatButton(type="primary",
- elem_style=dict(insetInlineEnd=24 + 70))
-
- with antd.FloatButton(elem_style=dict(insetInlineEnd=24 + 70 +
- 70)):
- with ms.Slot("icon"):
- antd.Icon("QuestionCircleOutlined")
- with antd.FloatButton(type="primary",
- description="Tooltip",
- elem_style=dict(insetInlineEnd=24 + 140 +
- 70)):
- with ms.Slot("tooltip"):
- ms.Div("Documents")
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/form/README-zh_CN.md b/components/antd/form/README-zh_CN.md
deleted file mode 100644
index 4def98ab8d218a5a56d12c76c4e54f4a626ef168..0000000000000000000000000000000000000000
--- a/components/antd/form/README-zh_CN.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# Form
-
-High-performance form component with data domain management. Includes data entry, validation, and corresponding styles. See [Ant Design](https://ant.design/components/form/) for more information.
-
-## Examples
-
-
-
diff --git a/components/antd/form/README.md b/components/antd/form/README.md
deleted file mode 100644
index 4def98ab8d218a5a56d12c76c4e54f4a626ef168..0000000000000000000000000000000000000000
--- a/components/antd/form/README.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# Form
-
-High-performance form component with data domain management. Includes data entry, validation, and corresponding styles. See [Ant Design](https://ant.design/components/form/) for more information.
-
-## Examples
-
-
-
diff --git a/components/antd/form/app.py b/components/antd/form/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/form/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/form/demos/basic.py b/components/antd/form/demos/basic.py
deleted file mode 100644
index fdec954578e1bbb8b0adaac121d9e37929af8c4c..0000000000000000000000000000000000000000
--- a/components/antd/form/demos/basic.py
+++ /dev/null
@@ -1,93 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-
-def on_submit(_form):
- print(_form) # the Form Component will automatically collect the form data
-
-
-def on_change(_form):
- return gr.update(layout=_form["layout"],
- disabled=_form["form_disabled"],
- variant=_form["variant"])
-
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Form(value={
- "layout": "horizontal",
- "remember": True,
- "form_disabled": False,
- "variant": "outlined",
- },
- variant="outlined",
- label_col=dict(span=8),
- wrapper_col=dict(span=16),
- layout="horizontal") as form:
- with antd.Form.Item(form_name="form_disabled",
- value_prop_name="checked"):
- with antd.Checkbox(disabled=False):
- ms.Text("Form disabled")
- with antd.Form.Item(form_name="layout", label="Form Layout"):
- antd.Radio.Group(options=[{
- "label": "Horizontal",
- "value": "horizontal"
- }, {
- "label": "Vertical",
- "value": "vertical"
- }, {
- "label": "Inline",
- "value": "inline"
- }])
- with antd.Form.Item(form_name="variant", label="Form variant"):
- antd.Segmented(
- options=['outlined', 'filled', 'borderless'])
- with antd.Form.Item(form_name="username",
- label="Username",
- tooltip="This is a required field",
- rules=[{
- "required":
- True,
- "message":
- 'Please input your username!'
- }]):
- antd.Input()
- with antd.Form.Item(form_name="password",
- label="Password",
- tooltip="This is a required field",
- rules=[{
- "required":
- True,
- "message":
- 'Please input your password!'
- }]):
- antd.Input.Password()
- with antd.Form.Item(form_name="files", label="Upload"):
- with antd.Upload.Dragger():
- with ms.Div(
- elem_style=dict(fontSize=40, color="#1677ff")):
- antd.Icon("InboxOutlined")
- antd.Typography.Paragraph(
- "Click or drag file to this area to upload")
- antd.Typography.Paragraph(
- "Support for a single or bulk upload.",
- type="secondary")
-
- with antd.Form.Item(
- wrapper_col=dict(offset=8, span=16),
- form_name="remember",
- value_prop_name="checked",
- ):
- with antd.Checkbox():
- ms.Text("Remember me")
- with antd.Form.Item(wrapper_col=dict(offset=8, span=16)):
- submit_btn = antd.Button("Submit",
- type="primary",
- html_type="submit")
- form.values_change(on_change, inputs=[form], outputs=[form])
- form.finish(on_submit, inputs=[form])
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/form/demos/form_rules.py b/components/antd/form/demos/form_rules.py
deleted file mode 100644
index 843cfec8f88dd314ab3aa185e46a0b454d3afba7..0000000000000000000000000000000000000000
--- a/components/antd/form/demos/form_rules.py
+++ /dev/null
@@ -1,66 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-
-def on_submit(_form):
- print(_form) # the Form Component will automatically collect the form data
-
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Form(label_col=dict(span=8),
- wrapper_col=dict(span=16)) as form:
- with antd.Form.Item(
- form_name="username",
- label="Username",
- rules=[{
- "required": True,
- "message": 'Please input your username!'
- }, {
- "pattern":
- "^[a-zA-Z0-9]+$",
- "message":
- "Username can only contain letters and numbers!"
- }, {
- "min":
- 6,
- "message":
- "Username must be at least 6 characters long!"
- }, {
- "max":
- 20,
- "message":
- "Username must be at most 20 characters long!"
- }]):
- antd.Input()
- with antd.Form.Item(
- form_name="password",
- label="Password",
- rules=[
- {
- "required": True,
- "message": 'Please input your password!'
- },
- {
- # custom validator with javascript function
- "validator":
- """(rule, value, cb) => {
- if (value !== '123') {
- cb('Password must be "123"')
- }
- cb()
- }"""
- }
- ]):
- antd.Input.Password()
-
- with antd.Form.Item(wrapper_col=dict(offset=8, span=16)):
- submit_btn = antd.Button("Submit",
- type="primary",
- html_type="submit")
- form.finish(on_submit, inputs=[form])
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/grid/README-zh_CN.md b/components/antd/grid/README-zh_CN.md
deleted file mode 100644
index 2d7b27bf2c24be13e12bf201afd89eeda835c41a..0000000000000000000000000000000000000000
--- a/components/antd/grid/README-zh_CN.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# Grid
-
-24 Grids System. See [Ant Design](https://ant.design/components/grid/) for more information.
-
-## Examples
-
-
-
diff --git a/components/antd/grid/README.md b/components/antd/grid/README.md
deleted file mode 100644
index 2d7b27bf2c24be13e12bf201afd89eeda835c41a..0000000000000000000000000000000000000000
--- a/components/antd/grid/README.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# Grid
-
-24 Grids System. See [Ant Design](https://ant.design/components/grid/) for more information.
-
-## Examples
-
-
-
diff --git a/components/antd/grid/app.py b/components/antd/grid/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/grid/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/grid/demos/basic.py b/components/antd/grid/demos/basic.py
deleted file mode 100644
index 028789a4c8fb11222baac215007f14ca87971b67..0000000000000000000000000000000000000000
--- a/components/antd/grid/demos/basic.py
+++ /dev/null
@@ -1,24 +0,0 @@
-import json
-
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Row(gutter=[6, 10]):
- with antd.Col(span=6):
- ms.Text("Col-6")
- with antd.Col(span=12):
- ms.Text("Col-12")
- with antd.Col(span=6):
- ms.Text("Col-6")
- with antd.Col(span=6):
- ms.Text("Col-6")
- with antd.Col(span=12):
- ms.Text("Col-12")
- with antd.Col(span=6):
- ms.Text("Col-6")
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/grid/demos/playground.py b/components/antd/grid/demos/playground.py
deleted file mode 100644
index a1acba4a4568af3395ce5a663c2fe48b093b5dc2..0000000000000000000000000000000000000000
--- a/components/antd/grid/demos/playground.py
+++ /dev/null
@@ -1,89 +0,0 @@
-import json
-
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-gutters = {}
-vgutters = {}
-col_counts = {}
-
-for i, v in enumerate([8, 16, 24, 32, 40, 48]):
- gutters[str(i)] = vgutters[str(i)] = v
-
-for i, v in enumerate([2, 3, 4, 6, 8, 12]):
- col_counts[str(i)] = v
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- ms.Span("Horizontal Gutter (px): ")
- with ms.Div(elem_style=dict(width="50%")):
- horizontal_slider = antd.Slider(
- value=1,
- min=0,
- max=len(gutters) - 1,
- marks=gutters,
- step=None,
- tooltip=dict(
- formatter=f"(value) => ({json.dumps(gutters)}[value])")
- )
- ms.Span("Vertical Gutter (px): ")
- with ms.Div(elem_style=dict(width="50%")):
- vertical_slider = antd.Slider(
- value=1,
- min=0,
- max=len(vgutters) - 1,
- marks=vgutters,
- step=None,
- tooltip=dict(
- formatter=f"(value) => ({json.dumps(vgutters)}[value])"
- ))
- ms.Span("Column Count: ")
- with ms.Div(elem_style=dict(width="50%", marginBottom=48)):
- count_slider = antd.Slider(
- value=1,
- min=0,
- max=len(col_counts) - 1,
- marks=col_counts,
- step=None,
- tooltip=dict(
- formatter=
- f"(value) => ({json.dumps(col_counts)}[value])"))
- with antd.Row(gutter=[gutters["1"], vgutters["1"]]) as row:
- with ms.Each(value=[{
- "span": 8
- }, {
- "span": 8
- }, {
- "span": 8
- }] * 2) as cols:
- with antd.Col(elem_style=dict(background="transparent",
- border=0)):
- ms.Div("Column",
- elem_style=dict(height=120,
- fontSize=14,
- lineHeight='120px',
- background="#0092ff",
- borderRadius=4,
- color="#fff",
- textAlign='center'))
-
- def on_change(_horizontal_slider, _vertical_slider, _count_slider):
- return gr.update(gutter=[
- gutters[str(_horizontal_slider)], vgutters[str(
- _vertical_slider)]
- ]), gr.update(
- value=[{
- "span": int(24 / col_counts[str(_count_slider)])
- } for _ in range(col_counts[str(_count_slider)])] * 2)
-
- gr.on([
- horizontal_slider.change, vertical_slider.change,
- count_slider.change
- ],
- fn=on_change,
- inputs=[horizontal_slider, vertical_slider, count_slider],
- outputs=[row, cols])
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/icon/README-zh_CN.md b/components/antd/icon/README-zh_CN.md
deleted file mode 100644
index 4305174efc7f28f0e23d00d3c1cf8c203554d013..0000000000000000000000000000000000000000
--- a/components/antd/icon/README-zh_CN.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# Icon
-
-Semantic vector graphics. See [Ant Design](https://ant.design/components/icon/) for more information.
-
-## Examples
-
-
-
-
diff --git a/components/antd/icon/README.md b/components/antd/icon/README.md
deleted file mode 100644
index 4305174efc7f28f0e23d00d3c1cf8c203554d013..0000000000000000000000000000000000000000
--- a/components/antd/icon/README.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# Icon
-
-Semantic vector graphics. See [Ant Design](https://ant.design/components/icon/) for more information.
-
-## Examples
-
-
-
-
diff --git a/components/antd/icon/app.py b/components/antd/icon/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/icon/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/icon/demos/basic.py b/components/antd/icon/demos/basic.py
deleted file mode 100644
index 0509dbd239e206f54d41a7b90f6cab927e60cca9..0000000000000000000000000000000000000000
--- a/components/antd/icon/demos/basic.py
+++ /dev/null
@@ -1,19 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Space():
- antd.Icon("HomeOutlined")
- antd.Icon("SettingFilled")
- antd.Icon("SmileOutlined")
- antd.Icon("SyncOutlined", spin=True)
- antd.Icon("SmileOutlined", rotate=180)
- antd.Icon("LoadingOutlined")
- antd.Icon("SmileTwoTone")
- icon = antd.Icon("HeartTwoTone", two_tone_color="#eb2f96")
- icon.click(lambda: print("clicked"))
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/icon/demos/iconfont.py b/components/antd/icon/demos/iconfont.py
deleted file mode 100644
index 018f77aa50d0f0a13e099b9941c18cb5f15dcad5..0000000000000000000000000000000000000000
--- a/components/antd/icon/demos/iconfont.py
+++ /dev/null
@@ -1,21 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- # If you are using [iconfont.cn](https://www.iconfont.cn/), you can use the icons in your project gracefully.
- with antd.Icon.IconfontProvider(script_url=[
- "//at.alicdn.com/t/font_8d5l8fzk5b87iudi.js",
- "//at.alicdn.com/t/font_1788592_a5xf2bdic3u.js"
- ]):
- with antd.Space():
- antd.Icon("icon-python")
- antd.Icon("icon-tuichu")
- antd.Icon("icon-facebook",
- elem_style=dict(color="#1877F2"))
- antd.Icon("icon-twitter")
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/image/README-zh_CN.md b/components/antd/image/README-zh_CN.md
deleted file mode 100644
index cd6eed9e0ab42b3cbda213d001837204d22006c6..0000000000000000000000000000000000000000
--- a/components/antd/image/README-zh_CN.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Image
-
-Preview-able image. See [Ant Design](https://ant.design/components/image/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/image/README.md b/components/antd/image/README.md
deleted file mode 100644
index cd6eed9e0ab42b3cbda213d001837204d22006c6..0000000000000000000000000000000000000000
--- a/components/antd/image/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Image
-
-Preview-able image. See [Ant Design](https://ant.design/components/image/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/image/app.py b/components/antd/image/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/image/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/image/demos/basic.py b/components/antd/image/demos/basic.py
deleted file mode 100644
index 4b7381c4b5e70a5b54b0531757a57489f309ac2d..0000000000000000000000000000000000000000
--- a/components/antd/image/demos/basic.py
+++ /dev/null
@@ -1,39 +0,0 @@
-import os
-
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- antd.Image(
- "https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png",
- width=200)
- antd.Image(
- "https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png",
- preview=False,
- width=200)
- antd.Image(
- os.path.join(os.path.dirname(__file__),
- "../resources/modelscope.png"))
- antd.Divider("Multiple image preview")
- with antd.Image.PreviewGroup():
- antd.Image(
- "https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg",
- width=200)
- antd.Image(
- "https://gw.alipayobjects.com/zos/antfincdn/aPkFc8Sj7n/method-draw-image.svg",
- width=200)
- antd.Divider("Preview from one image")
- with antd.Image.PreviewGroup(items=[
- 'https://gw.alipayobjects.com/zos/antfincdn/LlvErxo8H9/photo-1503185912284-5271ff81b9a8.webp',
- 'https://gw.alipayobjects.com/zos/antfincdn/cV16ZqzMjW/photo-1473091540282-9b846e7965e3.webp',
- 'https://gw.alipayobjects.com/zos/antfincdn/x43I27A55%26/photo-1438109491414-7198515b166b.webp',
- ]):
- antd.Image(
- "https://gw.alipayobjects.com/zos/antfincdn/LlvErxo8H9/photo-1503185912284-5271ff81b9a8.webp",
- width=200)
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/image/resources/modelscope.png b/components/antd/image/resources/modelscope.png
deleted file mode 100644
index 1fb167d3fefdd804744be42404612032e4fc534f..0000000000000000000000000000000000000000
Binary files a/components/antd/image/resources/modelscope.png and /dev/null differ
diff --git a/components/antd/input/README-zh_CN.md b/components/antd/input/README-zh_CN.md
deleted file mode 100644
index c1c832ce44bb7317cd1fefe063216d0be3d7edab..0000000000000000000000000000000000000000
--- a/components/antd/input/README-zh_CN.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Input
-
-Through mouse or keyboard input content, it is the most basic form field wrapper. See [Ant Design](https://ant.design/components/input/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/input/README.md b/components/antd/input/README.md
deleted file mode 100644
index c1c832ce44bb7317cd1fefe063216d0be3d7edab..0000000000000000000000000000000000000000
--- a/components/antd/input/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Input
-
-Through mouse or keyboard input content, it is the most basic form field wrapper. See [Ant Design](https://ant.design/components/input/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/input/app.py b/components/antd/input/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/input/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/input/demos/basic.py b/components/antd/input/demos/basic.py
deleted file mode 100644
index c9bb8cbcafdbddd1dce0193f46669d54f5cc1830..0000000000000000000000000000000000000000
--- a/components/antd/input/demos/basic.py
+++ /dev/null
@@ -1,30 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Space(direction="vertical"):
- antd.Input()
- antd.Input.Password()
- antd.Input.Textarea(
- placeholder=
- "Autosize height with minimum and maximum number of lines",
- auto_size={
- "minRows": 2,
- "maxRows": 6
- })
- antd.Input.Search(placeholder="Input search text",
- addon_before="https://",
- allow_clear=True)
- with antd.Input.Search(enter_button="Search",
- placeholder="input search text",
- size="large"):
- with ms.Slot("suffix"):
- antd.Icon("AudioOutlined",
- elem_style=dict(fontSize=16,
- color="#1677ff"))
- antd.Input.OTP()
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/input_number/README-zh_CN.md b/components/antd/input_number/README-zh_CN.md
deleted file mode 100644
index ae09ddd8155785e35e8c16350f50418648efb1f5..0000000000000000000000000000000000000000
--- a/components/antd/input_number/README-zh_CN.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# InputNumber
-
-Enter a number within certain range with the mouse or keyboard. See [Ant Design](https://ant.design/components/input-number/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/input_number/README.md b/components/antd/input_number/README.md
deleted file mode 100644
index ae09ddd8155785e35e8c16350f50418648efb1f5..0000000000000000000000000000000000000000
--- a/components/antd/input_number/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# InputNumber
-
-Enter a number within certain range with the mouse or keyboard. See [Ant Design](https://ant.design/components/input-number/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/input_number/app.py b/components/antd/input_number/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/input_number/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/input_number/demos/basic.py b/components/antd/input_number/demos/basic.py
deleted file mode 100644
index 0967cd173ef514dbdd30e988b5b9084e80fcce6a..0000000000000000000000000000000000000000
--- a/components/antd/input_number/demos/basic.py
+++ /dev/null
@@ -1,41 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Space(direction="vertical"):
- antd.InputNumber()
- antd.InputNumber(min=1, max=10, keyboard=True)
- antd.InputNumber(value=100, addon_after="$", addon_before="+")
- with antd.InputNumber(value=100):
- with ms.Slot("addonBefore"):
- antd.Select(value="add",
- elem_style=dict(width=60),
- options=[{
- "value": "add",
- "label": "+"
- }, {
- "value": "minus",
- "label": "-"
- }])
- with ms.Slot("addonAfter"):
- antd.Select(value="USD",
- elem_style=dict(width=60),
- options=[{
- "value": "USD",
- "label": "$"
- }, {
- "value": "EUR",
- "label": "€"
- }, {
- "value": "GBP",
- "label": "£"
- }, {
- "value": "CNY",
- "label": "¥"
- }])
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/layout/README-zh_CN.md b/components/antd/layout/README-zh_CN.md
deleted file mode 100644
index dd78e41f375f6f85fdab538ce4f76137d4f0e4e1..0000000000000000000000000000000000000000
--- a/components/antd/layout/README-zh_CN.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Layout
-
-Handling the overall layout of a page. See [Ant Design](https://ant.design/components/layout/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/layout/README.md b/components/antd/layout/README.md
deleted file mode 100644
index dd78e41f375f6f85fdab538ce4f76137d4f0e4e1..0000000000000000000000000000000000000000
--- a/components/antd/layout/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Layout
-
-Handling the overall layout of a page. See [Ant Design](https://ant.design/components/layout/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/layout/app.py b/components/antd/layout/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/layout/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/layout/demos/basic.py b/components/antd/layout/demos/basic.py
deleted file mode 100644
index e80ca98363fcda45a2380ff2090eb5d94fbff0ed..0000000000000000000000000000000000000000
--- a/components/antd/layout/demos/basic.py
+++ /dev/null
@@ -1,87 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-header_style = {
- "textAlign": 'center',
- "color": '#fff',
- "height": 64,
- "paddingInline": 48,
- "lineHeight": '64px',
- "backgroundColor": '#4096ff',
-}
-
-content_style = {
- "textAlign": 'center',
- "minHeight": 120,
- "lineHeight": '120px',
- "color": '#fff',
- "backgroundColor": '#0958d9',
-}
-
-sider_style = {
- "textAlign": 'center',
- "lineHeight": '120px',
- "color": '#fff',
- "backgroundColor": '#1677ff',
-}
-
-footer_style = {
- "textAlign": 'center',
- "color": '#fff',
- "backgroundColor": '#4096ff',
-}
-
-layout_style = {
- "borderRadius": 8,
- "overflow": 'hidden',
- "width": 'calc(50% - 8px)',
- "maxWidth": 'calc(50% - 8px)',
-}
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Flex(gap="middle", wrap="wrap"):
- with antd.Layout(elem_style=layout_style):
- with antd.Layout.Header(elem_style=header_style):
- ms.Text("Header")
- with antd.Layout.Content(elem_style=content_style):
- ms.Text("Content")
- with antd.Layout.Footer(elem_style=footer_style):
- ms.Text("Footer")
- with antd.Layout(elem_style=layout_style):
- with antd.Layout.Header(elem_style=header_style):
- ms.Text("Header")
- with antd.Layout():
- with antd.Layout.Sider(width="25%",
- elem_style=sider_style):
- ms.Text("Sider")
- with antd.Layout.Content(elem_style=content_style):
- ms.Text("Content")
- with antd.Layout.Footer(elem_style=footer_style):
- ms.Text("Footer")
- with antd.Layout(elem_style=layout_style):
- with antd.Layout.Header(elem_style=header_style):
- ms.Text("Header")
- with antd.Layout():
- with antd.Layout.Content(elem_style=content_style):
- ms.Text("Content")
- with antd.Layout.Sider(width="25%",
- elem_style=sider_style):
- ms.Text("Sider")
- with antd.Layout.Footer(elem_style=footer_style):
- ms.Text("Footer")
- with antd.Layout(elem_style=layout_style):
- with antd.Layout.Sider(width="25%",
- elem_style=sider_style):
- ms.Text("Sider")
- with antd.Layout():
- with antd.Layout.Header(elem_style=header_style):
- ms.Text("Header")
- with antd.Layout.Content(elem_style=content_style):
- ms.Text("Content")
- with antd.Layout.Footer(elem_style=footer_style):
- ms.Text("Footer")
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/list/README-zh_CN.md b/components/antd/list/README-zh_CN.md
deleted file mode 100644
index 14165ff022f0f9e417ee9dde45eee01f907240d6..0000000000000000000000000000000000000000
--- a/components/antd/list/README-zh_CN.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# List
-
-Basic list display, which can carry text, lists, pictures, paragraphs. See [Ant Design](https://ant.design/components/list/) for more information.
-
-## Examples
-
-
-
diff --git a/components/antd/list/README.md b/components/antd/list/README.md
deleted file mode 100644
index 14165ff022f0f9e417ee9dde45eee01f907240d6..0000000000000000000000000000000000000000
--- a/components/antd/list/README.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# List
-
-Basic list display, which can carry text, lists, pictures, paragraphs. See [Ant Design](https://ant.design/components/list/) for more information.
-
-## Examples
-
-
-
diff --git a/components/antd/list/app.py b/components/antd/list/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/list/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/list/demos/basic.py b/components/antd/list/demos/basic.py
deleted file mode 100644
index b6bad1a2a97d529404d71da364f8cc3c294560ca..0000000000000000000000000000000000000000
--- a/components/antd/list/demos/basic.py
+++ /dev/null
@@ -1,54 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-data = [{
- "text": 'Racing car sprays burning fuel into crowd.',
-}, {
- "text": 'Japanese princess to wed commoner.',
-}, {
- "text": 'Australian walks 100km after outback crash.',
-}, {
- "text": 'Man charged over missing wedding girl.',
-}, {
- "text": 'Los Angeles battles huge wildfires.',
-}]
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- antd.Divider("Static Render")
- with antd.List(header="Header", footer="Footer", bordered=True):
- for item in data:
- with antd.List.Item():
- antd.Typography.Text("[ITEM]", mark=True)
- ms.Text(item["text"])
-
- antd.Divider("Dynamic Render")
- with antd.List(header="Header",
- footer="Footer",
- data_source=data,
- bordered=True):
- with ms.Slot("renderItem", params_mapping="(item) => item"):
- with antd.List.Item():
- antd.Typography.Text("[ITEM]", mark=True)
- ms.Text(as_item="text")
- antd.Divider("Dynamic Render with JavaScript")
- antd.List(header="Header",
- footer="Footer",
- bordered=True,
- data_source=data,
- render_item="""(item) => {
- const React = window.ms_globals.React;
- const antd = window.ms_globals.antd;
- return React.createElement(
- antd.List.Item,
- null,
- React.createElement(antd.Typography.Text, { mark: true }, '[ITEM]'),
- React.createElement(antd.Typography.Text, null, item.text)
- );
-};
-""")
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/list/demos/vertical_item.py b/components/antd/list/demos/vertical_item.py
deleted file mode 100644
index 7ec8066a5e59209b56db98ea707bcf79cba73c84..0000000000000000000000000000000000000000
--- a/components/antd/list/demos/vertical_item.py
+++ /dev/null
@@ -1,66 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-data = [{
- 'avatar': {
- "src": f'https://api.dicebear.com/7.x/miniavs/svg?seed={i}'
- },
- "link": {
- "href": "https://ant.design",
- "value": f"ant design part {i}"
- },
- "img": {
- "src":
- "https://gw.alipayobjects.com/zos/rmsportal/mqaQswcyDLcXyDKnZfES.png"
- },
- "meta": {
- 'description':
- 'Ant Design, a design language for background applications, is refined by Ant UED Team.',
- },
- 'content':
- 'We supply a series of design principles, practical patterns and high quality design resources (Sketch and Axure), to help people create their product prototypes beautifully and efficiently.'
-} for i in range(10)]
-
-page_size = 3
-
-
-def IconText(icon: str, text: str):
- with antd.Space():
- antd.Icon(icon)
- ms.Text(text)
-
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.List(item_layout="vertical",
- size="large",
- data_source=data,
- pagination=dict(total=len(data),
- pageSize=page_size)) as list:
- with ms.Slot("footer"):
- with ms.Div():
- antd.Typography.Text('ant design', strong=True)
- ms.Text("footer part")
- with ms.Slot("renderItem",
- params_mapping="""(item) => item"""):
- with antd.List.Item():
- with ms.Slot("actions"):
- IconText('StarOutlined', 156)
- IconText('LikeOutlined', 156)
- IconText('MessageOutlined', 3)
- with ms.Slot("extra"):
- antd.Image(preview=False,
- alt="logo",
- width=272,
- as_item="img")
- with antd.List.Item.Meta(as_item="meta"):
- with ms.Slot("avatar"):
- antd.Avatar(as_item="avatar")
- with ms.Slot("title"):
- antd.Typography.Link(as_item="link")
- ms.Span(as_item="content")
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/mentions/README-zh_CN.md b/components/antd/mentions/README-zh_CN.md
deleted file mode 100644
index a4edd7015cd46ff41f776cf92e493ed9e1ec7f92..0000000000000000000000000000000000000000
--- a/components/antd/mentions/README-zh_CN.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# Mentions
-
-Used to mention someone or something in an input. See [Ant Design](https://ant.design/components/mentions/) for more information.
-
-## Examples
-
-
-
diff --git a/components/antd/mentions/README.md b/components/antd/mentions/README.md
deleted file mode 100644
index a4edd7015cd46ff41f776cf92e493ed9e1ec7f92..0000000000000000000000000000000000000000
--- a/components/antd/mentions/README.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# Mentions
-
-Used to mention someone or something in an input. See [Ant Design](https://ant.design/components/mentions/) for more information.
-
-## Examples
-
-
-
diff --git a/components/antd/mentions/app.py b/components/antd/mentions/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/mentions/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/mentions/demos/basic.py b/components/antd/mentions/demos/basic.py
deleted file mode 100644
index a7c5a7eea82b7f04d0e79fd48f284bbd313bbc23..0000000000000000000000000000000000000000
--- a/components/antd/mentions/demos/basic.py
+++ /dev/null
@@ -1,35 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Space(direction="vertical"):
- antd.Mentions(elem_style=dict(width=320),
- placeholder="Input @ to mention",
- options=[{
- "value": "modelscope",
- "label": "modelscope"
- }, {
- "value": "gradio",
- "label": "gradio"
- }, {
- "value": "ant design",
- "label": "ant design"
- }])
- with antd.Mentions(elem_style=dict(width=320),
- prefix=['@', "#"],
- placeholder="Input @ or # to mention"):
- with antd.Mentions.Option(value="modelscope"):
- with ms.Slot("label"):
- antd.Typography.Text("modelscope", type="success")
- with antd.Mentions.Option(value="gradio"):
- with ms.Slot("label"):
- antd.Typography.Text("gradio", type="success")
- with antd.Mentions.Option(value="ant design"):
- with ms.Slot("label"):
- antd.Typography.Text("ant design", type="success")
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/mentions/demos/dynamic_options.py b/components/antd/mentions/demos/dynamic_options.py
deleted file mode 100644
index e4428648df967e2adf214c3b84b5980247837dbb..0000000000000000000000000000000000000000
--- a/components/antd/mentions/demos/dynamic_options.py
+++ /dev/null
@@ -1,42 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-
-def on_search(e: gr.EventData):
- prefix = e._data['payload'][1]
- if prefix == '@':
- return gr.update(options=[{
- "value": "modelscope",
- "label": "modelscope"
- }, {
- "value": "gradio",
- "label": "gradio"
- }, {
- "value": "ant design",
- "label": "ant design"
- }])
- elif prefix == '#':
- return gr.update(options=[{
- "value": "1.0",
- "label": "1.0"
- }, {
- "value": "2.0",
- "label": "2.0"
- }, {
- "value": "3.0",
- "label": "3.0"
- }])
-
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- mentions = antd.Mentions(
- elem_style=dict(width='100%'),
- prefix=['@', "#"],
- placeholder="input @ to mention people, # to mention tag")
- mentions.search(fn=on_search, outputs=[mentions])
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/menu/README-zh_CN.md b/components/antd/menu/README-zh_CN.md
deleted file mode 100644
index b01c0a99516fd74910fb8cea226ad747f742f444..0000000000000000000000000000000000000000
--- a/components/antd/menu/README-zh_CN.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Menu
-
-A versatile menu for navigation. See [Ant Design](https://ant.design/components/menu/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/menu/README.md b/components/antd/menu/README.md
deleted file mode 100644
index b01c0a99516fd74910fb8cea226ad747f742f444..0000000000000000000000000000000000000000
--- a/components/antd/menu/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Menu
-
-A versatile menu for navigation. See [Ant Design](https://ant.design/components/menu/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/menu/app.py b/components/antd/menu/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/menu/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/menu/demos/basic.py b/components/antd/menu/demos/basic.py
deleted file mode 100644
index 5493f79a756edc6bad4ca0ee234fe608e17415d6..0000000000000000000000000000000000000000
--- a/components/antd/menu/demos/basic.py
+++ /dev/null
@@ -1,63 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-default_mode = 'horizontal'
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- mode_select = antd.Select(value=default_mode,
- options=[{
- "label": "horizontal",
- "value": "horizontal"
- }, {
- "label": "inline",
- "value": "inline"
- }, {
- "label": "vertical",
- "value": "vertical"
- }],
- elem_style=dict(width=200))
- inline_collapsed_switch = antd.Switch(
- False,
- checked_children="Inline Collapsed",
- un_checked_children="Inline Expanded")
- with antd.Menu(selected_keys=[default_mode],
- mode="horizontal") as menu:
- with antd.Menu.Item(key="mail", label="Navigation One"):
- with ms.Slot("icon"):
- antd.Icon("MailOutlined")
- with antd.Menu.Item(key="app",
- label="Navigation Two",
- disabled=True):
- with ms.Slot("icon"):
- antd.Icon("AppstoreOutlined")
- with antd.Menu.Item(key="SubMenu",
- label="Navigation Three - Submenu"):
- with ms.Slot("icon"):
- antd.Icon("SettingOutlined")
- with antd.Menu.Item(type="group", label="Item 1"):
- antd.Menu.Item(label="Option 1", key="setting:1")
- antd.Menu.Item(label="Option 2", key="setting:2")
- with antd.Menu.Item(type="group", label="Item 2"):
- antd.Menu.Item(label="Option 3", key="setting:3")
- antd.Menu.Item(label="Option 4", key="setting:4")
- with antd.Menu.Item(key="modelscope",
- label="Navigation Four - Link"):
- with ms.Slot("label"):
- antd.Button("Navigation Four - Link",
- type="link",
- href="https://modelscope.cn",
- href_target="_blank")
- mode_select.change(
- fn=lambda _mode_select: gr.update(mode=_mode_select),
- inputs=[mode_select],
- outputs=[menu])
- inline_collapsed_switch.change(
- fn=lambda _inline_collapsed_switch: gr.update(
- inline_collapsed=_inline_collapsed_switch),
- inputs=[inline_collapsed_switch],
- outputs=[menu])
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/message/README-zh_CN.md b/components/antd/message/README-zh_CN.md
deleted file mode 100644
index 6a29b6234f3685987cb72a7eba3552813da6c929..0000000000000000000000000000000000000000
--- a/components/antd/message/README-zh_CN.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Message
-
-Display global messages as feedback in response to user operations. See [Ant Design](https://ant.design/components/message/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/message/README.md b/components/antd/message/README.md
deleted file mode 100644
index 6a29b6234f3685987cb72a7eba3552813da6c929..0000000000000000000000000000000000000000
--- a/components/antd/message/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Message
-
-Display global messages as feedback in response to user operations. See [Ant Design](https://ant.design/components/message/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/message/app.py b/components/antd/message/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/message/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/message/demos/basic.py b/components/antd/message/demos/basic.py
deleted file mode 100644
index 82ade195502d1548d31cfe964a620b67b9f49c9a..0000000000000000000000000000000000000000
--- a/components/antd/message/demos/basic.py
+++ /dev/null
@@ -1,50 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-
-def info():
- return gr.update(visible=True,
- type="info",
- content="This is a info message.",
- key="info")
-
-
-def success():
- return gr.update(visible=True,
- type="success",
- content="This is a success message.",
- key="success")
-
-
-def error():
- return gr.update(visible=True,
- type="error",
- content="This is an error message.",
- key="error")
-
-
-def warning():
- return gr.update(visible=True,
- type="warning",
- content="This is a warning message.",
- key="warning")
-
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Space():
- info_btn = antd.Button("Info")
- success_btn = antd.Button("Success")
- error_btn = antd.Button("Error")
- warning_btn = antd.Button("Warning")
-
- message = antd.Message(visible=False)
- info_btn.click(info, outputs=[message])
- success_btn.click(success, outputs=[message])
- error_btn.click(error, outputs=[message])
- warning_btn.click(warning, outputs=[message])
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/modal/README-zh_CN.md b/components/antd/modal/README-zh_CN.md
deleted file mode 100644
index 3e0f5e093c13407ffd2b4b7bf41b1621753433a7..0000000000000000000000000000000000000000
--- a/components/antd/modal/README-zh_CN.md
+++ /dev/null
@@ -1,12 +0,0 @@
-# Modal
-
-Display a modal dialog box, providing a title, content area, and action buttons. See [Ant Design](https://ant.design/components/modal/) for more information.
-
-## Examples
-
-
-
-
-Like `Message` and `Notification`, `Modal` can be used as a static method.
-
-
diff --git a/components/antd/modal/README.md b/components/antd/modal/README.md
deleted file mode 100644
index 3e0f5e093c13407ffd2b4b7bf41b1621753433a7..0000000000000000000000000000000000000000
--- a/components/antd/modal/README.md
+++ /dev/null
@@ -1,12 +0,0 @@
-# Modal
-
-Display a modal dialog box, providing a title, content area, and action buttons. See [Ant Design](https://ant.design/components/modal/) for more information.
-
-## Examples
-
-
-
-
-Like `Message` and `Notification`, `Modal` can be used as a static method.
-
-
diff --git a/components/antd/modal/app.py b/components/antd/modal/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/modal/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/modal/demos/basic.py b/components/antd/modal/demos/basic.py
deleted file mode 100644
index 1a65085b3a068eeaebc667f1c3ac95a0907a658c..0000000000000000000000000000000000000000
--- a/components/antd/modal/demos/basic.py
+++ /dev/null
@@ -1,18 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- btn = antd.Button("Open Modal", type="primary")
- with antd.Modal(open=False, title="Basic Modal") as modal:
- antd.Typography.Paragraph("Some contents...")
- antd.Typography.Paragraph("Some contents...")
- antd.Typography.Paragraph("Some contents...")
- btn.click(lambda: gr.update(open=True), outputs=[modal])
-
- modal.ok(lambda: gr.update(open=False), outputs=[modal])
- modal.cancel(lambda: gr.update(open=False), outputs=[modal])
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/modal/demos/custom_footer.py b/components/antd/modal/demos/custom_footer.py
deleted file mode 100644
index ad242ff3c03d0bfc3caa5e605e0ef6ac69d7d2e9..0000000000000000000000000000000000000000
--- a/components/antd/modal/demos/custom_footer.py
+++ /dev/null
@@ -1,30 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- btn = antd.Button("Open Modal", type="primary")
- with antd.Modal(open=False, title="Basic Modal") as modal:
- with ms.Slot("footer"):
- cancel_btn = antd.Button("Return")
- submit_btn = antd.Button("Submit", type="primary")
- link_btn = antd.Button("Search on Google",
- type="primary",
- href_target="_blank",
- href="https://google.com")
- antd.Typography.Paragraph("Some contents...")
- antd.Typography.Paragraph("Some contents...")
- antd.Typography.Paragraph("Some contents...")
- btn.click(lambda: gr.update(open=True), outputs=[modal])
-
- modal.ok(lambda: gr.update(open=False), outputs=[modal])
-
- cancel_btn.click(lambda: gr.update(open=False), outputs=[modal])
- modal.cancel(lambda: gr.update(open=False), outputs=[modal])
- gr.on([submit_btn.click, link_btn.click],
- fn=lambda: gr.update(open=False),
- outputs=[modal])
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/modal/demos/static.py b/components/antd/modal/demos/static.py
deleted file mode 100644
index cc0137499e61bbe6ef7125cceb61906f703ec476..0000000000000000000000000000000000000000
--- a/components/antd/modal/demos/static.py
+++ /dev/null
@@ -1,73 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-
-def info():
- return gr.update(
- visible=True,
- mask_closable=False,
- title="Info",
- type="info",
- content="This is a info message.",
- )
-
-
-def success():
- return gr.update(
- visible=True,
- mask_closable=False,
- title="Success",
- type="success",
- content="This is a success message.",
- )
-
-
-def error():
- return gr.update(
- visible=True,
- mask_closable=False,
- title="Error",
- type="error",
- content="This is an error message.",
- )
-
-
-def warning():
- return gr.update(
- visible=True,
- mask_closable=False,
- title="Warning",
- type="warning",
- content="This is a warning message.",
- )
-
-
-def confirm():
- return gr.update(
- visible=True,
- mask_closable=True,
- title="Confirm",
- type="confirm",
- content="This is a confirm message.",
- )
-
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Space():
- info_btn = antd.Button("Info")
- success_btn = antd.Button("Success")
- error_btn = antd.Button("Error")
- warning_btn = antd.Button("Warning")
- confirm_btn = antd.Button("Confirm")
-
- modal = antd.Modal.Static(visible=False)
- info_btn.click(info, outputs=[modal])
- success_btn.click(success, outputs=[modal])
- error_btn.click(error, outputs=[modal])
- warning_btn.click(warning, outputs=[modal])
- confirm_btn.click(confirm, outputs=[modal])
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/notification/README-zh_CN.md b/components/antd/notification/README-zh_CN.md
deleted file mode 100644
index 0070d377106e24f93d03172d2dde6feb6b971c26..0000000000000000000000000000000000000000
--- a/components/antd/notification/README-zh_CN.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Notification
-
-Prompt notification message globally. See [Ant Design](https://ant.design/components/notification/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/notification/README.md b/components/antd/notification/README.md
deleted file mode 100644
index 0070d377106e24f93d03172d2dde6feb6b971c26..0000000000000000000000000000000000000000
--- a/components/antd/notification/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Notification
-
-Prompt notification message globally. See [Ant Design](https://ant.design/components/notification/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/notification/app.py b/components/antd/notification/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/notification/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/notification/demos/basic.py b/components/antd/notification/demos/basic.py
deleted file mode 100644
index cd6a9aabe31fd71a4306438ba23b91e0d1596f0f..0000000000000000000000000000000000000000
--- a/components/antd/notification/demos/basic.py
+++ /dev/null
@@ -1,58 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-
-def info():
- return gr.update(visible=True,
- type="info",
- message="Info Notification Message",
- description="This is a info description.",
- placement="topLeft",
- key="info")
-
-
-def success():
- return gr.update(visible=True,
- type="success",
- message="Success Notification Message",
- description="This is a success description.",
- placement="topRight",
- key="success")
-
-
-def error():
- return gr.update(visible=True,
- type="error",
- message="Error Notification Message",
- description="This is an error description.",
- placement="bottomLeft",
- key="error")
-
-
-def warning():
- return gr.update(visible=True,
- type="warning",
- message="Warning Notification Message",
- description="This is a warning description.",
- placement="bottomRight",
- key="warning")
-
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Space():
- info_btn = antd.Button("Info")
- success_btn = antd.Button("Success")
- error_btn = antd.Button("Error")
- warning_btn = antd.Button("Warning")
-
- notification = antd.Notification(visible=False)
- info_btn.click(info, outputs=[notification])
- success_btn.click(success, outputs=[notification])
- error_btn.click(error, outputs=[notification])
- warning_btn.click(warning, outputs=[notification])
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/overview/README-zh_CN.md b/components/antd/overview/README-zh_CN.md
deleted file mode 100644
index e4ab567abb81f8af3058105f0956448fcad14f80..0000000000000000000000000000000000000000
--- a/components/antd/overview/README-zh_CN.md
+++ /dev/null
@@ -1,73 +0,0 @@
-# 概览
-
-`modelscope_studio`集成了 [Ant Design](https://ant.design/) 的组件,并支持大部分的组件属性,您只需要引入`antd`模块即可直接使用。
-
-```python
-import modelscope_studio.components.antd as antd
-```
-
-## 快速开始
-
-
-
-注意:其中`ms.Application`与`antd.ConfigProvider`是必须的。
-
-- `Application` 包含了`modelscope_studio`中所有的组件依赖,请确保`modelscope_studio`所有导出的组件都被其包裹,否则页面将会无法成功预览。
-- `ConfigProvider` 与 Ant Design 中的功能一致,除此之外,我们还加了一些额外的适配来兼容 Gradio 的样式。因此,为了保证页面样式正常,所有的`antd`组件需要包裹在该组件下。
-
-## 属性限制
-
-由于 Python 的类型限制,一些组件属性的支持形式有所不同。
-
-### 事件
-
-在`antd`中,所有以`onXxx`形式绑定的事件,均改为了`gradio`的事件绑定形式,如`onClick`、`onChange`等。如果您想要获取事件参数,也需要绑定`gr.EventData`,所有的事件参数都通过数组的形式保存在`e._data["payload"]`中。
-
-
-
-### ReactNode
-
-在 Python 中无法直接将某个组件作为参数,因此我们提供了插槽机制,您可以使用`ms.Slot`来包裹需要被渲染的模块。
-
-
-
-**注:**
-
-- 您可以通过查看组件的`SLOTS`属性获取所有支持的插槽。
-- 如果您只想渲染一段字符串或数字,您依然可以直接将其作为组件的属性传入,无需使用`ms.Slot`。下面两种写法效果是一样的,并且更推荐直接作为组件属性传入:
-
- ```python
- antd.Card(title="Card Title")
-
- with antd.Card():
- ms.Slot("title"):
- ms.Text("Card Title")
- ```
-
-### 普通函数((...args) => {})
-
-为了支持在 Python 直接传入 Javascript 函数,我们将其改为了`str`类型。因此,您只需要传递普通的函数字符串即可,它会在前端被自动编译为 Javascript 函数。
-
-
-
-我们在全局注入了事件通知对象,您可以通过在函数中调用`window.ms_globals.dispatch`来主动向 Python 端发送事件,在 Python 端可以通过`ms.Application.custom`事件接收。
-
-
-
-### 返回 ReactNode 的函数 ((...args) => ReactNode)
-
-当您的 Javascript 函数返回值为 ReactNode 时,我们提供了两种处理方式:
-
-1. 将其当做普通的 ReactNode 值,继续使用`ms.Slot`来渲染模块,在此基础上,`ms.Slot`还支持传入`params_mapping`参数,该参数同样接收一个 Javascript 函数字符串,它可以将函数的参数映射为当前`slot`环境的上下文(具体请参考`ms.Each`)。
-
-
-
-2. 将其当做普通函数,通过`window.ms_globals.React`与`window.ms_globals.antd`等全局变量在前端生成 ReactNode(注意此时不能使用 jsx,需要使用 `React.createElement`)。
-
-
-
-## 集成其他 Gradio 组件
-
-某些组件的插槽可能只支持`modelscope_studio`中的组件,如果您想要支持其他的 Gradio 组件,您需要使用`Fragment`来将其包裹。
-
-
diff --git a/components/antd/overview/README.md b/components/antd/overview/README.md
deleted file mode 100644
index 82bb9278703414a46891fbeff9530cd6627a97d7..0000000000000000000000000000000000000000
--- a/components/antd/overview/README.md
+++ /dev/null
@@ -1,73 +0,0 @@
-# Overview
-
-`modelscope_studio` integrates [Ant Design](https://ant.design/) components and supports most component properties. You can use them directly by importing the `antd` module.
-
-```python
-import modelscope_studio.components.antd as antd
-```
-
-## Quick Start
-
-
-
-Note: Both `ms.Application` and `antd.ConfigProvider` are required.
-
-- `Application` contains all component dependencies in `modelscope_studio`. Please ensure that all components exported from `modelscope_studio` are wrapped by it, otherwise the page will not be successfully previewed.
-- `ConfigProvider` functions the same as in Ant Design. Additionally, we have added some extra adaptations to be compatible with Gradio's styles. Therefore, to ensure normal page styling, all `antd` components need to be wrapped within this component.
-
-## Property Limitations
-
-Due to Python's type restrictions, the support for some component properties differs.
-
-### Events
-
-In `antd`, all events bound in the form of `onXxx` have been changed to Gradio's event binding form, such as `onClick`, `onChange`, etc. If you want to get event parameters, you also need to bind `gr.EventData`. All event parameters are stored in the form of an array in `e._data["payload"]`.
-
-
-
-### ReactNode
-
-In Python, it's not possible to directly pass a component as a parameter, so we provide a slot mechanism. You can use `ms.Slot` to wrap the module that needs to be rendered.
-
-
-
-**Note:**
-
-- You can view the `SLOTS` property of the component to get all supported slots.
-- If you only want to render a string or number, you can still pass it directly as a component property without using `ms.Slot`. The following two ways of writing have the same effect, and it's more recommended to pass it directly as a component property:
-
- ```python
- antd.Card(title="Card Title")
-
- with antd.Card():
- ms.Slot("title"):
- ms.Text("Card Title")
- ```
-
-### Regular Functions ((...args) => {})
-
-To support passing JavaScript functions directly in Python, we have changed them to `str` type. Therefore, you only need to pass a regular function string, and it will be automatically compiled into a JavaScript function on the frontend.
-
-
-
-We have injected a global event notification object. You can actively send events to the Python side by calling `window.ms_globals.dispatch` in the function, which can be received on the Python side through the `ms.Application.custom` event.
-
-
-
-### Functions Returning ReactNode ((...args) => ReactNode)
-
-When your JavaScript function returns a ReactNode, we provide two handling methods:
-
-1. Treat it as a regular ReactNode value and continue using `ms.Slot` to render the module. Additionally, `ms.Slot` supports passing a `params_mapping` parameter, which also accepts a JavaScript function string. It can map the function's parameters to the context of the current `slot` environment (refer to `ms.Each` for details).
-
-
-
-2. Treat it as a regular function and generate ReactNode on the frontend using global variables like `window.ms_globals.React` and `window.ms_globals.antd` (note that JSX cannot be used here, you need to use `React.createElement`).
-
-
-
-## Integrating Other Gradio Components
-
-Some component slots may only support components from `modelscope_studio`. If you want to support other Gradio components, you need to wrap them with `Fragment`.
-
-
diff --git a/components/antd/overview/app.py b/components/antd/overview/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/overview/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/overview/demos/integrate_other_components.py b/components/antd/overview/demos/integrate_other_components.py
deleted file mode 100644
index dd1217be91f8f87da40b0189c5a1dba52230ded8..0000000000000000000000000000000000000000
--- a/components/antd/overview/demos/integrate_other_components.py
+++ /dev/null
@@ -1,16 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Space():
- antd.Button("1")
- antd.Button("2")
- # other gradio components
- with ms.Fragment():
- gr.Button("3")
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/overview/demos/limit_event.py b/components/antd/overview/demos/limit_event.py
deleted file mode 100644
index d634e4a97947e354f1b487f3c55a5f15fa178947..0000000000000000000000000000000000000000
--- a/components/antd/overview/demos/limit_event.py
+++ /dev/null
@@ -1,17 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-
-def on_change(e: gr.EventData):
- print(e._data["payload"])
-
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- rate = antd.Rate()
- rate.change(on_change)
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/overview/demos/limit_function.py b/components/antd/overview/demos/limit_function.py
deleted file mode 100644
index 3b19001273dc290c1c071c6e1280515496c94765..0000000000000000000000000000000000000000
--- a/components/antd/overview/demos/limit_function.py
+++ /dev/null
@@ -1,13 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- antd.Input(show_count=dict(formatter="""({ count }) => {
- return `${count} characters`;
- }"""))
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/overview/demos/limit_function_with_event.py b/components/antd/overview/demos/limit_function_with_event.py
deleted file mode 100644
index d2565b4159a6565972ea9f71acdbf58757c6b9e9..0000000000000000000000000000000000000000
--- a/components/antd/overview/demos/limit_function_with_event.py
+++ /dev/null
@@ -1,20 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-
-def on_custom(e: gr.EventData):
- print(e._data)
-
-
-with gr.Blocks() as demo:
- with ms.Application() as app:
- with antd.ConfigProvider():
- antd.Input(show_count=dict(formatter="""({ count }) => {
- window.ms_globals.dispatch({ type: "input_count_change", payload: count });
- return `${count} characters`;
- }"""))
- app.custom(on_custom)
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/overview/demos/limit_react_node.py b/components/antd/overview/demos/limit_react_node.py
deleted file mode 100644
index 4100747be78c5e775ac133cd3d18540364e8f393..0000000000000000000000000000000000000000
--- a/components/antd/overview/demos/limit_react_node.py
+++ /dev/null
@@ -1,21 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Card():
- ms.Div("Card Content")
- ms.Div("Card Content")
- ms.Div("Card Content")
- # slots
- with ms.Slot("title"):
- ms.Text("Card Title")
- with ms.Slot("extra"):
- with antd.Button():
- ms.Text("GitHub")
- with ms.Slot("icon"):
- antd.Icon("GithubOutlined")
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/overview/demos/limit_react_node_function_by_function.py b/components/antd/overview/demos/limit_react_node_function_by_function.py
deleted file mode 100644
index d03566c73d9e687a595ea5cc4e04d3d5dbb7b86e..0000000000000000000000000000000000000000
--- a/components/antd/overview/demos/limit_react_node_function_by_function.py
+++ /dev/null
@@ -1,74 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-
-def on_custom(e: gr.EventData):
- print(e._data)
-
-
-with gr.Blocks() as demo:
- with ms.Application() as app:
- with antd.ConfigProvider():
- with antd.Table([
- {
- "key": '1',
- "name": 'Mike',
- "age": 32,
- "address": '10 Downing Street',
- },
- {
- "key": '2',
- "name": 'John',
- "age": 42,
- "address": '11 Downing Street',
- },
- ],
- pagination=False):
- antd.Table.Column(title="Name", data_index="name", key="name")
- antd.Table.Column(title="Age", data_index="age", key="age")
- antd.Table.Column(title="Address",
- data_index="address",
- key="address")
- antd.Table.Column(title="Action",
- key="action",
- column_render="""(_, record) => {
- const React = window.ms_globals.React;
- const antd = window.ms_globals.antd;
- const dispatch = window.ms_globals.dispatch;
- return React.createElement(antd.Space, {
- size: "middle",
- children: [
- React.createElement(antd.Button, {
- type: "link",
- onClick: () => {
- dispatch({
- type: "table_column_action",
- payload: {
- action: "invite",
- record,
- },
- });
- },
- children: "Invite " + record.name
- }),
- React.createElement(antd.Button, {
- type: "link",
- children: "Delete",
- onClick: () => {
- dispatch({
- type: "table_column_action",
- payload: {
- action: "delete",
- record,
- },
- });
- },
- }),
- ],
- });
- }""")
-
- app.custom(on_custom)
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/overview/demos/limit_react_node_function_by_slot.py b/components/antd/overview/demos/limit_react_node_function_by_slot.py
deleted file mode 100644
index 6a8c518c40c4c41f65831d8649bc8efc3c13d433..0000000000000000000000000000000000000000
--- a/components/antd/overview/demos/limit_react_node_function_by_slot.py
+++ /dev/null
@@ -1,14 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Statistic(title="Active Users", value=112893):
- with ms.Slot("formatter",
- params_mapping="(value) => ({ text: { value }})"):
- antd.Typography.Text(type="success", as_item="text")
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/overview/demos/quick_start.py b/components/antd/overview/demos/quick_start.py
deleted file mode 100644
index 4ca0ed26f7adf02e6f69e6807ada28ea57855b01..0000000000000000000000000000000000000000
--- a/components/antd/overview/demos/quick_start.py
+++ /dev/null
@@ -1,11 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- antd.Button("Hello Ant Design", type="primary")
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/pagination/README-zh_CN.md b/components/antd/pagination/README-zh_CN.md
deleted file mode 100644
index b8af2424acdae0c1f9874491b06aa90fce46b1ef..0000000000000000000000000000000000000000
--- a/components/antd/pagination/README-zh_CN.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Pagination
-
-A long list can be divided into several pages, and only one page will be loaded at a time. See [Ant Design](https://ant.design/components/pagination/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/pagination/README.md b/components/antd/pagination/README.md
deleted file mode 100644
index b8af2424acdae0c1f9874491b06aa90fce46b1ef..0000000000000000000000000000000000000000
--- a/components/antd/pagination/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Pagination
-
-A long list can be divided into several pages, and only one page will be loaded at a time. See [Ant Design](https://ant.design/components/pagination/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/pagination/app.py b/components/antd/pagination/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/pagination/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/pagination/demos/basic.py b/components/antd/pagination/demos/basic.py
deleted file mode 100644
index 9d805501e6fb66adb2c6b3d1397feb62aab539bd..0000000000000000000000000000000000000000
--- a/components/antd/pagination/demos/basic.py
+++ /dev/null
@@ -1,14 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- antd.Pagination(total=85,
- show_quick_jumper=True,
- show_size_changer=True,
- show_total="(total) => `Total ${total} items`")
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/popconfirm/README-zh_CN.md b/components/antd/popconfirm/README-zh_CN.md
deleted file mode 100644
index 972483ca2c1eebdae708335d9b0820dbba256fbb..0000000000000000000000000000000000000000
--- a/components/antd/popconfirm/README-zh_CN.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Popconfirm
-
-Pop up a bubble confirmation box for an action. See [Ant Design](https://ant.design/components/popconfirm/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/popconfirm/README.md b/components/antd/popconfirm/README.md
deleted file mode 100644
index 972483ca2c1eebdae708335d9b0820dbba256fbb..0000000000000000000000000000000000000000
--- a/components/antd/popconfirm/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Popconfirm
-
-Pop up a bubble confirmation box for an action. See [Ant Design](https://ant.design/components/popconfirm/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/popconfirm/app.py b/components/antd/popconfirm/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/popconfirm/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/popconfirm/demos/basic.py b/components/antd/popconfirm/demos/basic.py
deleted file mode 100644
index dbb5b1e91642345beb51642f77ff205210b82d32..0000000000000000000000000000000000000000
--- a/components/antd/popconfirm/demos/basic.py
+++ /dev/null
@@ -1,18 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Popconfirm(
- title="Delete the task",
- description="Are you sure to delete this task?",
- ok_text="Yes",
- cancel_text="No") as popconfirm:
- antd.Button("Delete", danger=True)
- popconfirm.confirm(lambda: print("confirm"))
- popconfirm.cancel(lambda: print("cancel"))
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/popover/README-zh_CN.md b/components/antd/popover/README-zh_CN.md
deleted file mode 100644
index 61fee781aba475b20b2378bfe0ec03609c750465..0000000000000000000000000000000000000000
--- a/components/antd/popover/README-zh_CN.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Popover
-
-The floating card pops up when clicking/mouse hovering over an element. See [Ant Design](https://ant.design/components/popover/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/popover/README.md b/components/antd/popover/README.md
deleted file mode 100644
index 61fee781aba475b20b2378bfe0ec03609c750465..0000000000000000000000000000000000000000
--- a/components/antd/popover/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Popover
-
-The floating card pops up when clicking/mouse hovering over an element. See [Ant Design](https://ant.design/components/popover/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/popover/app.py b/components/antd/popover/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/popover/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/popover/demos/basic.py b/components/antd/popover/demos/basic.py
deleted file mode 100644
index 0a997afd0faac6225cdadad74a60501e036dbbb3..0000000000000000000000000000000000000000
--- a/components/antd/popover/demos/basic.py
+++ /dev/null
@@ -1,29 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-
-def Content():
- antd.Typography.Paragraph("Content")
- antd.Typography.Paragraph("Content")
-
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Space():
- with antd.Popover(title="Title", trigger="hover"):
- with ms.Slot("content"):
- Content()
- antd.Button("Hover me", type="primary")
- with antd.Popover(title="Title", trigger="focus"):
- with ms.Slot("content"):
- Content()
- antd.Button("Focus me", type="primary")
- with antd.Popover(title="Title", trigger="click"):
- with ms.Slot("content"):
- Content()
- antd.Button("Click me", type="primary")
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/progress/README-zh_CN.md b/components/antd/progress/README-zh_CN.md
deleted file mode 100644
index 325305096c2132647acbb8f470dbab5398cecbc7..0000000000000000000000000000000000000000
--- a/components/antd/progress/README-zh_CN.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Progress
-
-Display the current progress of the operation. See [Ant Design](https://ant.design/components/progress/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/progress/README.md b/components/antd/progress/README.md
deleted file mode 100644
index 325305096c2132647acbb8f470dbab5398cecbc7..0000000000000000000000000000000000000000
--- a/components/antd/progress/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Progress
-
-Display the current progress of the operation. See [Ant Design](https://ant.design/components/progress/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/progress/app.py b/components/antd/progress/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/progress/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/progress/demos/basic.py b/components/antd/progress/demos/basic.py
deleted file mode 100644
index 3cdc95e6ce3c470f074f3c580412d48362945e9d..0000000000000000000000000000000000000000
--- a/components/antd/progress/demos/basic.py
+++ /dev/null
@@ -1,38 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Flex(gap="small", vertical=True):
- antd.Progress(percent=30)
- antd.Progress(percent=50, status='active')
- antd.Progress(percent=70, status="exception")
- antd.Progress(percent=100)
- antd.Progress(percent=50, show_info=False)
- antd.Divider("Circular progress bar")
- with antd.Flex(gap="small", wrap=True):
- antd.Progress(type="circle", percent=75)
- antd.Progress(type="circle", percent=70, status="exception")
- antd.Progress(type="circle", percent=100)
- antd.Progress(
- type="circle",
- percent=100,
- format=
- """( percent ) => percent === 100 ? 'Done' : percent + '%' """
- )
- antd.Divider("Progress bar with steps")
- with antd.Flex(gap="small", vertical=True):
- antd.Progress(percent=50, steps=3)
- antd.Progress(percent=30, steps=5)
- antd.Progress(percent=100,
- steps=5,
- size="small",
- stroke_color='#f56a00')
- antd.Progress(percent=60,
- steps=5,
- stroke_color=['#f56a00', '#1890ff', '#13c2c2'])
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/qr_code/README-zh_CN.md b/components/antd/qr_code/README-zh_CN.md
deleted file mode 100644
index aee01c17512cdfae62d11c9e1944fa636800df27..0000000000000000000000000000000000000000
--- a/components/antd/qr_code/README-zh_CN.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# QRCode
-
-Components that can convert text into QR codes, and support custom color and logo. See [Ant Design](https://ant.design/components/qr-code/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/qr_code/README.md b/components/antd/qr_code/README.md
deleted file mode 100644
index aee01c17512cdfae62d11c9e1944fa636800df27..0000000000000000000000000000000000000000
--- a/components/antd/qr_code/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# QRCode
-
-Components that can convert text into QR codes, and support custom color and logo. See [Ant Design](https://ant.design/components/qr-code/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/qr_code/app.py b/components/antd/qr_code/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/qr_code/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/qr_code/demos/basic.py b/components/antd/qr_code/demos/basic.py
deleted file mode 100644
index cefd7758f7a21d5a61300fb86b5c5dc79407d325..0000000000000000000000000000000000000000
--- a/components/antd/qr_code/demos/basic.py
+++ /dev/null
@@ -1,18 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- antd.QRCode("https://ant.design")
- antd.Divider("With Icon")
- antd.QRCode(
- value="https://ant.design/",
- error_level='H',
- icon=
- "https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg"
- )
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/radio/README-zh_CN.md b/components/antd/radio/README-zh_CN.md
deleted file mode 100644
index 71aea44541e1aaa79446602c3329b027d752e7b3..0000000000000000000000000000000000000000
--- a/components/antd/radio/README-zh_CN.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Radio
-
-Used to select a single state from multiple options. See [Ant Design](https://ant.design/components/radio/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/radio/README.md b/components/antd/radio/README.md
deleted file mode 100644
index 71aea44541e1aaa79446602c3329b027d752e7b3..0000000000000000000000000000000000000000
--- a/components/antd/radio/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Radio
-
-Used to select a single state from multiple options. See [Ant Design](https://ant.design/components/radio/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/radio/app.py b/components/antd/radio/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/radio/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/radio/demos/basic.py b/components/antd/radio/demos/basic.py
deleted file mode 100644
index d20d13c1a6d2f30edd0ce6ee53edd368ffa8b858..0000000000000000000000000000000000000000
--- a/components/antd/radio/demos/basic.py
+++ /dev/null
@@ -1,39 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Radio():
- ms.Text("Radio")
- antd.Divider("Radio Group")
- with antd.Radio.Group():
- with antd.Radio(group_value=1):
- ms.Text("A")
- with antd.Radio(group_value=2):
- ms.Text("B")
- with antd.Radio(group_value=3):
- ms.Text("C")
- with antd.Radio(group_value=4):
- ms.Text("D")
- antd.Divider("Configuring Options")
- antd.Radio.Group(option_type="button",
- button_style="solid",
- options=[
- {
- "label": 'Apple',
- "value": 'Apple'
- },
- {
- "label": 'Pear',
- "value": 'Pear'
- },
- {
- "label": 'Orange',
- "value": 'Orange',
- "disabled": True
- },
- ])
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/rate/README-zh_CN.md b/components/antd/rate/README-zh_CN.md
deleted file mode 100644
index 13098b21ef12657322134a3a491de2b87e908a18..0000000000000000000000000000000000000000
--- a/components/antd/rate/README-zh_CN.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Rate
-
-Used for rating operation on something. See [Ant Design](https://ant.design/components/rate/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/rate/README.md b/components/antd/rate/README.md
deleted file mode 100644
index 13098b21ef12657322134a3a491de2b87e908a18..0000000000000000000000000000000000000000
--- a/components/antd/rate/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Rate
-
-Used for rating operation on something. See [Ant Design](https://ant.design/components/rate/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/rate/app.py b/components/antd/rate/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/rate/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/rate/demos/basic.py b/components/antd/rate/demos/basic.py
deleted file mode 100644
index aaefa6022ddac2b293bc545edeba029623043c71..0000000000000000000000000000000000000000
--- a/components/antd/rate/demos/basic.py
+++ /dev/null
@@ -1,19 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Space(direction="vertical"):
- antd.Rate(tooltips=[
- 'terrible', 'bad', 'normal', 'good', 'wonderful'
- ])
- antd.Rate(allow_half=True, allow_clear=False)
- antd.Rate(value=2, character="({ index = 0 }) => index + 1")
- antd.Rate(value=2, character="A", allow_half=True)
- with antd.Rate(value=3):
- with ms.Slot("character"):
- antd.Icon("SmileOutlined")
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/result/README-zh_CN.md b/components/antd/result/README-zh_CN.md
deleted file mode 100644
index 450ad8f47b9626db67ee0066251069942a29295e..0000000000000000000000000000000000000000
--- a/components/antd/result/README-zh_CN.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Result
-
-Used to feedback the processing results of a series of operations. See [Ant Design](https://ant.design/components/result/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/result/README.md b/components/antd/result/README.md
deleted file mode 100644
index 450ad8f47b9626db67ee0066251069942a29295e..0000000000000000000000000000000000000000
--- a/components/antd/result/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Result
-
-Used to feedback the processing results of a series of operations. See [Ant Design](https://ant.design/components/result/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/result/app.py b/components/antd/result/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/result/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/result/demos/basic.py b/components/antd/result/demos/basic.py
deleted file mode 100644
index 6d281bc505dc96a3d243eadc5ca5c1c43d6bf3c4..0000000000000000000000000000000000000000
--- a/components/antd/result/demos/basic.py
+++ /dev/null
@@ -1,56 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- antd.Divider("Success")
- with antd.Result(
- status="success",
- title="Successfully Purchased Cloud Server ECS!",
- sub_title=
- "Order number: 2017182818828182881 Cloud server configuration takes 1-5 minutes, please wait.",
- ):
- with ms.Slot("extra"):
- antd.Button("Go Console", type="primary")
- antd.Button("Buy Again")
- antd.Divider("Info")
- with antd.Result(title="Your operation has been executed", ):
- with ms.Slot("extra"):
- antd.Button("Go Console", type="primary")
- antd.Divider("Warning")
- with antd.Result(
- status="warning",
- title="There are some problems with your operation.",
- ):
- with ms.Slot("extra"):
- antd.Button("Go Console", type="primary")
- antd.Divider("Error")
- with antd.Result(
- status="error",
- title="Submission Failed.",
- sub_title=
- "Please check and modify the following information before resubmitting."
- ):
- with ms.Slot("extra"):
- antd.Button("Go Console", type="primary")
- antd.Button("Buy Again")
- with ms.Div():
- with antd.Typography.Paragraph():
- antd.Typography.Text(
- "The content you submitted has the following error:",
- strong=True,
- elem_style=dict(fontSize=16))
- with antd.Typography.Paragraph():
- antd.Icon("CloseCircleOutlined",
- elem_style=dict(color="red"))
- ms.Text("Your account has been frozen.")
- antd.Typography.Link("Thaw immediately >")
- with antd.Typography.Paragraph():
- antd.Icon("CloseCircleOutlined",
- elem_style=dict(color="red"))
- ms.Text("our account is not yet eligible to apply.")
- antd.Typography.Link("TApply Unlock >")
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/segmented/README-zh_CN.md b/components/antd/segmented/README-zh_CN.md
deleted file mode 100644
index 4d70176be7087717aace2a269a3ce5464f7909f7..0000000000000000000000000000000000000000
--- a/components/antd/segmented/README-zh_CN.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Segmented
-
-Display multiple options and allow users to select a single option. See [Ant Design](https://ant.design/components/segmented/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/segmented/README.md b/components/antd/segmented/README.md
deleted file mode 100644
index 4d70176be7087717aace2a269a3ce5464f7909f7..0000000000000000000000000000000000000000
--- a/components/antd/segmented/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Segmented
-
-Display multiple options and allow users to select a single option. See [Ant Design](https://ant.design/components/segmented/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/segmented/app.py b/components/antd/segmented/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/segmented/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/segmented/demos/basic.py b/components/antd/segmented/demos/basic.py
deleted file mode 100644
index 959754fffc1b36d1094ee297644c97e3eb3fe5bc..0000000000000000000000000000000000000000
--- a/components/antd/segmented/demos/basic.py
+++ /dev/null
@@ -1,52 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Space(direction="vertical"):
- antd.Segmented(options=[
- 'Daily', 'Weekly', 'Monthly', 'Quarterly', 'Yearly'
- ])
- antd.Segmented(options=[
- 'Daily',
- {
- "label": 'Weekly',
- "value": 'Weekly',
- "disabled": True
- },
- 'Monthly',
- {
- "label": 'Quarterly',
- "value": 'Quarterly',
- "disabled": True
- },
- 'Yearly',
- ])
- with antd.Segmented():
- with antd.Segmented.Option(value="user1"):
- with ms.Slot("label"):
- with ms.Div():
- antd.Avatar(
- "https://api.dicebear.com/7.x/miniavs/svg?seed=8"
- )
- ms.Div("User 1")
- with antd.Segmented.Option(value="user2"):
- with ms.Slot("label"):
- with ms.Div(elem_style=dict(padding=4)):
- with antd.Avatar(elem_style=dict(
- backgroundColor="#f56a00")):
- ms.Text("K")
- ms.Div("User 2")
- with antd.Segmented.Option(value="user3"):
- with ms.Slot("label"):
- with ms.Div(elem_style=dict(padding=4)):
- with antd.Avatar(elem_style=dict(
- backgroundColor="#87d068")):
- with ms.Slot("icon"):
- antd.Icon("UserOutlined")
- ms.Div("User 3")
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/select/README-zh_CN.md b/components/antd/select/README-zh_CN.md
deleted file mode 100644
index bd061d8a2e3ade21a334d42e5b2b3fec585fd1d9..0000000000000000000000000000000000000000
--- a/components/antd/select/README-zh_CN.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Select
-
-A dropdown menu for displaying choices. See [Ant Design](https://ant.design/components/select/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/select/README.md b/components/antd/select/README.md
deleted file mode 100644
index bd061d8a2e3ade21a334d42e5b2b3fec585fd1d9..0000000000000000000000000000000000000000
--- a/components/antd/select/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Select
-
-A dropdown menu for displaying choices. See [Ant Design](https://ant.design/components/select/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/select/app.py b/components/antd/select/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/select/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/select/demos/basic.py b/components/antd/select/demos/basic.py
deleted file mode 100644
index dcf9ae0e5b8bacbdb513a4dc51ea688306510e3b..0000000000000000000000000000000000000000
--- a/components/antd/select/demos/basic.py
+++ /dev/null
@@ -1,49 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Space(direction="vertical"):
- antd.Select(elem_style=dict(width=200),
- allow_clear=True,
- options=[
- {
- "value": 'jack',
- "label": 'Jack'
- },
- {
- "value": 'lucy',
- "label": 'Lucy'
- },
- {
- "value": 'Yiminghe',
- "label": 'yiminghe'
- },
- {
- "value": 'disabled',
- "label": 'Disabled',
- "disabled": True
- },
- ])
- # custom label
- with antd.Select(
- elem_style=dict(width=200),
- mode="multiple",
- ):
- with antd.Select.Option(value="jack"):
- with ms.Slot("label"):
- antd.Tag("Jack", color="red")
- with antd.Select.Option(value="lucy"):
- with ms.Slot("label"):
- antd.Tag("Lucy", color="green")
- with antd.Select.Option(value="Yiminghe"):
- with ms.Slot("label"):
- antd.Tag("Yiminghe", color="blue")
- with antd.Select.Option(value="disabled", disabled=True):
- with ms.Slot("label"):
- antd.Tag("Disabled", color="gray")
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/skeleton/README-zh_CN.md b/components/antd/skeleton/README-zh_CN.md
deleted file mode 100644
index 40b6d3ce0f57c485b10230d66aa692074b692d23..0000000000000000000000000000000000000000
--- a/components/antd/skeleton/README-zh_CN.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Skeleton
-
-Provide a placeholder while you wait for content to load, or to visualize content that doesn't exist yet. See [Ant Design](https://ant.design/components/skeleton/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/skeleton/README.md b/components/antd/skeleton/README.md
deleted file mode 100644
index 40b6d3ce0f57c485b10230d66aa692074b692d23..0000000000000000000000000000000000000000
--- a/components/antd/skeleton/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Skeleton
-
-Provide a placeholder while you wait for content to load, or to visualize content that doesn't exist yet. See [Ant Design](https://ant.design/components/skeleton/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/skeleton/app.py b/components/antd/skeleton/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/skeleton/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/skeleton/demos/basic.py b/components/antd/skeleton/demos/basic.py
deleted file mode 100644
index 9e11fe60a8c3d0e3e14d59907f0c5aa3cc8ea078..0000000000000000000000000000000000000000
--- a/components/antd/skeleton/demos/basic.py
+++ /dev/null
@@ -1,28 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Flex(gap="middle", vertical=True):
- antd.Skeleton()
- antd.Skeleton(avatar=True, paragraph=dict(rows=4))
- antd.Skeleton(active=True)
- antd.Divider("Button/Avatar/Input/Image/Node")
- with antd.Flex(vertical=True, gap="small"):
- with antd.Space():
- antd.Skeleton.Button()
- antd.Skeleton.Avatar()
- antd.Skeleton.Input()
- antd.Skeleton.Button(block=True)
- antd.Skeleton.Input(block=True)
- with antd.Space():
- antd.Skeleton.Image()
- antd.Skeleton.Node(elem_style=dict(width=160))
- with antd.Skeleton.Node():
- antd.Icon("DotChartOutlined",
- elem_style=dict(font_size=40,
- color="#bfbfbf"))
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/slider/README-zh_CN.md b/components/antd/slider/README-zh_CN.md
deleted file mode 100644
index c270882b9e1b33c7974877f9407a384a7aa9a692..0000000000000000000000000000000000000000
--- a/components/antd/slider/README-zh_CN.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# Slider
-
-A Slider component for displaying current value and intervals in range. See [Ant Design](https://ant.design/components/slider/) for more information.
-
-## Examples
-
-
-
diff --git a/components/antd/slider/README.md b/components/antd/slider/README.md
deleted file mode 100644
index c270882b9e1b33c7974877f9407a384a7aa9a692..0000000000000000000000000000000000000000
--- a/components/antd/slider/README.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# Slider
-
-A Slider component for displaying current value and intervals in range. See [Ant Design](https://ant.design/components/slider/) for more information.
-
-## Examples
-
-
-
diff --git a/components/antd/slider/app.py b/components/antd/slider/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/slider/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/slider/demos/basic.py b/components/antd/slider/demos/basic.py
deleted file mode 100644
index 5df7285b17cb6a8a89a63ddf6f4a5cc12b3f5803..0000000000000000000000000000000000000000
--- a/components/antd/slider/demos/basic.py
+++ /dev/null
@@ -1,20 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- antd.Slider(value=50)
- antd.Slider(range=True, value=[20, 50])
- antd.Divider("Vertical")
- antd.Slider(range=True,
- value=[20, 50],
- step=5,
- vertical=True,
- elem_style=dict(height=200))
- antd.Divider("Customize tooltip")
- antd.Slider(tooltip=dict(formatter="(value) => `${value}%`"))
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/slider/demos/marks.py b/components/antd/slider/demos/marks.py
deleted file mode 100644
index 7eaede56d43ed30683e44c32de5b7062974c8c82..0000000000000000000000000000000000000000
--- a/components/antd/slider/demos/marks.py
+++ /dev/null
@@ -1,42 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- antd.Slider(
- marks={
- "0": '0°C',
- "26": '26°C',
- "37": '37°C',
- "100": {
- "style": {
- "color": '#f50'
- },
- "label": "100°C",
- },
- })
- with antd.Slider():
- with ms.Slot("marks"):
- antd.Slider.Mark(
- number=0,
- label="0°C",
- )
- antd.Slider.Mark(
- number=26,
- label="26°C",
- )
- antd.Slider.Mark(
- number=37,
- label="37°C",
- )
- with antd.Slider.Mark(
- number=100,
- elem_style=dict(width=40),
- ):
- with ms.Slot("label"):
- antd.Typography.Text("100°C", type="success")
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/space/README-zh_CN.md b/components/antd/space/README-zh_CN.md
deleted file mode 100644
index 8eb5de8203bae6f08ad2b376c240e572b51561c1..0000000000000000000000000000000000000000
--- a/components/antd/space/README-zh_CN.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Space
-
-Set components spacing. See [Ant Design](https://ant.design/components/space/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/space/README.md b/components/antd/space/README.md
deleted file mode 100644
index 8eb5de8203bae6f08ad2b376c240e572b51561c1..0000000000000000000000000000000000000000
--- a/components/antd/space/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Space
-
-Set components spacing. See [Ant Design](https://ant.design/components/space/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/space/app.py b/components/antd/space/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/space/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/space/demos/basic.py b/components/antd/space/demos/basic.py
deleted file mode 100644
index 37b04201216928b51ee1fbfd40fb6bc62d4bc84f..0000000000000000000000000000000000000000
--- a/components/antd/space/demos/basic.py
+++ /dev/null
@@ -1,14 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Space():
- antd.Button("Primary", type="primary")
- antd.Button("Default")
- antd.Button("Dashed", type="dashed")
- ms.Text("Space")
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/spin/README-zh_CN.md b/components/antd/spin/README-zh_CN.md
deleted file mode 100644
index d5c1538e1f9398453fb3e45d1fcbb56e7908b9ee..0000000000000000000000000000000000000000
--- a/components/antd/spin/README-zh_CN.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Spin
-
-Used for the loading status of a page or a block. See [Ant Design](https://ant.design/components/spin/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/spin/README.md b/components/antd/spin/README.md
deleted file mode 100644
index d5c1538e1f9398453fb3e45d1fcbb56e7908b9ee..0000000000000000000000000000000000000000
--- a/components/antd/spin/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Spin
-
-Used for the loading status of a page or a block. See [Ant Design](https://ant.design/components/spin/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/spin/app.py b/components/antd/spin/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/spin/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/spin/demos/basic.py b/components/antd/spin/demos/basic.py
deleted file mode 100644
index 9245768a86e87f1984ac6cc3da30d94da8ee6c56..0000000000000000000000000000000000000000
--- a/components/antd/spin/demos/basic.py
+++ /dev/null
@@ -1,53 +0,0 @@
-import time
-
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-
-def show_loading():
- yield gr.update(spinning=True)
- time.sleep(2)
- yield gr.update(spinning=False)
-
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Flex(align="center", gap="middle"):
- antd.Spin(size="small")
- antd.Spin()
- antd.Spin(size="large")
- antd.Divider("Custom spinning indicator")
- with antd.Flex(align="center", gap="middle"):
- with antd.Spin(size="small"):
- with ms.Slot("indicator"):
- antd.Icon("LoadingOutlined", spin=True)
- with antd.Spin():
- with ms.Slot("indicator"):
- antd.Icon("LoadingOutlined", spin=True)
- with antd.Spin(size="large"):
- with ms.Slot("indicator"):
- antd.Icon("LoadingOutlined", spin=True)
- antd.Divider("Progress")
- with antd.Flex(align="center", gap="middle"):
- antd.Spin(percent=50, size="small")
- antd.Spin(percent=90)
- antd.Spin(percent="auto", size="large")
- antd.Divider("Embedded mode")
- with antd.Space(direction='vertical'):
- with antd.Spin(tip="Loading...", spinning=False) as spin1:
- antd.Alert(
- message="Alert message title",
- description=
- "Further details about the context of this alert.",
- type="info")
- antd.Button("Show loading").click(fn=show_loading,
- outputs=[spin1])
- antd.Divider("Fullscreen")
- spin2 = antd.Spin(spinning=False, fullscreen=True)
- antd.Button("Show fullscreen").click(fn=show_loading,
- outputs=[spin2])
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/splitter/README-zh_CN.md b/components/antd/splitter/README-zh_CN.md
deleted file mode 100644
index 68d7064db76ef6b4f35bd344399e89e9883993e0..0000000000000000000000000000000000000000
--- a/components/antd/splitter/README-zh_CN.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Splitter
-
-Split panels to isolate. See [Ant Design](https://ant.design/components/space/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/splitter/README.md b/components/antd/splitter/README.md
deleted file mode 100644
index 68d7064db76ef6b4f35bd344399e89e9883993e0..0000000000000000000000000000000000000000
--- a/components/antd/splitter/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Splitter
-
-Split panels to isolate. See [Ant Design](https://ant.design/components/space/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/splitter/app.py b/components/antd/splitter/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/splitter/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/splitter/demos/basic.py b/components/antd/splitter/demos/basic.py
deleted file mode 100644
index 30c83d69c5c6a15cddef60979fa7b8600fba2a85..0000000000000000000000000000000000000000
--- a/components/antd/splitter/demos/basic.py
+++ /dev/null
@@ -1,29 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-
-def Desc(text: str):
- with antd.Flex(justify="center"):
- with antd.Typography.Title(type="secondary",
- level=5,
- elem_style=dict(whiteSpace="nowrap")):
- ms.Text(text)
-
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Splitter(elem_style=dict(
- height=500, boxShadow='0 0 10px rgba(0, 0, 0, 0.1)')):
- with antd.Splitter.Panel(collapsible=True):
- Desc("Left")
- with antd.Splitter.Panel(collapsible=True):
- with antd.Splitter(layout="vertical"):
- with antd.Splitter.Panel():
- Desc("Top")
- with antd.Splitter.Panel():
- Desc("Bottom")
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/statistic/README-zh_CN.md b/components/antd/statistic/README-zh_CN.md
deleted file mode 100644
index 479752c7e97883afa6bc7de097fb1365b352f3be..0000000000000000000000000000000000000000
--- a/components/antd/statistic/README-zh_CN.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# Statistic
-
-Display statistic number. See [Ant Design](https://ant.design/components/statistic/) for more information.
-
-## Examples
-
-
-
diff --git a/components/antd/statistic/README.md b/components/antd/statistic/README.md
deleted file mode 100644
index 479752c7e97883afa6bc7de097fb1365b352f3be..0000000000000000000000000000000000000000
--- a/components/antd/statistic/README.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# Statistic
-
-Display statistic number. See [Ant Design](https://ant.design/components/statistic/) for more information.
-
-## Examples
-
-
-
diff --git a/components/antd/statistic/app.py b/components/antd/statistic/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/statistic/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/statistic/demos/basic.py b/components/antd/statistic/demos/basic.py
deleted file mode 100644
index c7514c7297f8b74da6df21acdeb70848794b3260..0000000000000000000000000000000000000000
--- a/components/antd/statistic/demos/basic.py
+++ /dev/null
@@ -1,24 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Row(gutter=20):
- with antd.Col(span=12):
- antd.Statistic(value=112893, title="Active Users")
- with antd.Col(span=12):
- antd.Statistic(value=112893,
- precision=2,
- title="Account Balance (CNY)")
- with antd.Col(span=12):
- with antd.Statistic(value=1128,
- precision=2,
- title="Feedback"):
- with ms.Slot("prefix"):
- antd.Icon("LikeOutlined")
- with antd.Col(span=12):
- antd.Statistic(value=93, suffix="/ 100", title="Unmerged")
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/statistic/demos/countdown.py b/components/antd/statistic/demos/countdown.py
deleted file mode 100644
index 2b72791128f7295689f4faa6d32c191eafd12d68..0000000000000000000000000000000000000000
--- a/components/antd/statistic/demos/countdown.py
+++ /dev/null
@@ -1,26 +0,0 @@
-import time
-
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Row(gutter=20):
- with antd.Col(span=12):
- antd.Statistic.Countdown(
- value=lambda: time.time() + 60 * 60 * 24 * 2,
- title="Countdown")
- with antd.Col(span=12):
- antd.Statistic.Countdown(
- value=lambda: time.time() + 60 * 60 * 24 * 2,
- title="Million Seconds",
- format="HH:mm:ss:SSS")
- with antd.Col(span=12):
- antd.Statistic.Countdown(
- value=lambda: time.time() + 60 * 60 * 24 * 2,
- title="Day Level",
- format="D-H-m-s")
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/steps/README-zh_CN.md b/components/antd/steps/README-zh_CN.md
deleted file mode 100644
index 0bf4394dbe6cb31c122bc9668485da5ee5dbcb01..0000000000000000000000000000000000000000
--- a/components/antd/steps/README-zh_CN.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Steps
-
-A navigation bar that guides users through the steps of a task. See [Ant Design](https://ant.design/components/steps/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/steps/README.md b/components/antd/steps/README.md
deleted file mode 100644
index 0bf4394dbe6cb31c122bc9668485da5ee5dbcb01..0000000000000000000000000000000000000000
--- a/components/antd/steps/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Steps
-
-A navigation bar that guides users through the steps of a task. See [Ant Design](https://ant.design/components/steps/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/steps/app.py b/components/antd/steps/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/steps/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/steps/demos/basic.py b/components/antd/steps/demos/basic.py
deleted file mode 100644
index 53c42b45803a004c2deefcc6fe924f94f3025b77..0000000000000000000000000000000000000000
--- a/components/antd/steps/demos/basic.py
+++ /dev/null
@@ -1,47 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-description = "This is a description."
-
-
-def on_next(_state):
- _state["current"] += 1
- return {
- steps: gr.update(current=_state["current"]),
- prev_btn: gr.update(visible=True if _state["current"] > 0 else False),
- next_btn: gr.update(visible=True if _state["current"] < 3 else False)
- }
-
-
-def on_prev(_state):
- _state["current"] -= 1
- return {
- steps: gr.update(current=_state["current"]),
- prev_btn: gr.update(visible=True if _state["current"] > 0 else False),
- next_btn: gr.update(visible=True if _state["current"] < 3 else False)
- }
-
-
-with gr.Blocks() as demo:
- state = gr.State({"current": 0})
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Steps(0) as steps:
- antd.Steps.Item(title="Waiting", description=description)
- antd.Steps.Item(title="In Progress",
- sub_title="Left 00:00:08",
- description=description)
- antd.Steps.Item(title="Finished", description=description)
- prev_btn = antd.Button("Prev", visible=False)
- next_btn = antd.Button("Next", type="primary")
-
- prev_btn.click(fn=on_prev,
- inputs=[state],
- outputs=[steps, prev_btn, next_btn])
- next_btn.click(fn=on_next,
- inputs=[state],
- outputs=[steps, prev_btn, next_btn])
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/switch/README-zh_CN.md b/components/antd/switch/README-zh_CN.md
deleted file mode 100644
index 9e067cff3b3004d0005312cbf092663472e1727f..0000000000000000000000000000000000000000
--- a/components/antd/switch/README-zh_CN.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Switch
-
-Used to toggle between two states. See [Ant Design](https://ant.design/components/switch/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/switch/README.md b/components/antd/switch/README.md
deleted file mode 100644
index 9e067cff3b3004d0005312cbf092663472e1727f..0000000000000000000000000000000000000000
--- a/components/antd/switch/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Switch
-
-Used to toggle between two states. See [Ant Design](https://ant.design/components/switch/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/switch/app.py b/components/antd/switch/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/switch/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/switch/demos/basic.py b/components/antd/switch/demos/basic.py
deleted file mode 100644
index f30b513c324738a26cfa099e59ec53ec97741ba3..0000000000000000000000000000000000000000
--- a/components/antd/switch/demos/basic.py
+++ /dev/null
@@ -1,19 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Space():
- antd.Switch(value=True)
- antd.Switch(checked_children="Open",
- un_checked_children="Close")
- with antd.Switch(value=True):
- with ms.Slot("checkedChildren"):
- antd.Icon("CheckOutlined")
- with ms.Slot("unCheckedChildren"):
- antd.Icon("CloseOutlined")
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/table/README-zh_CN.md b/components/antd/table/README-zh_CN.md
deleted file mode 100644
index ae5ad3ff4d6eabb324f6b8a833097f75170021b4..0000000000000000000000000000000000000000
--- a/components/antd/table/README-zh_CN.md
+++ /dev/null
@@ -1,12 +0,0 @@
-# Table
-
-A table displays rows of data. See [Ant Design](https://ant.design/components/table/) for more information.
-
-## Examples
-
-
-
-
-
-
-
diff --git a/components/antd/table/README.md b/components/antd/table/README.md
deleted file mode 100644
index ae5ad3ff4d6eabb324f6b8a833097f75170021b4..0000000000000000000000000000000000000000
--- a/components/antd/table/README.md
+++ /dev/null
@@ -1,12 +0,0 @@
-# Table
-
-A table displays rows of data. See [Ant Design](https://ant.design/components/table/) for more information.
-
-## Examples
-
-
-
-
-
-
-
diff --git a/components/antd/table/app.py b/components/antd/table/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/table/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/table/demos/basic.py b/components/antd/table/demos/basic.py
deleted file mode 100644
index c98060fcc51ff3ad262fdff617a76b0639459212..0000000000000000000000000000000000000000
--- a/components/antd/table/demos/basic.py
+++ /dev/null
@@ -1,30 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-data = [
- {
- "key": '1',
- "name": 'Mike',
- "age": 32,
- "address": '10 Downing Street',
- },
- {
- "key": '2',
- "name": 'John',
- "age": 42,
- "address": '10 Downing Street',
- },
-]
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Table(data_source=data):
- antd.Table.Column(title="Name", data_index="name", key="name")
- antd.Table.Column(title="Age", data_index="age", key="age")
- antd.Table.Column(title="Address",
- data_index="address",
- key="address")
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/table/demos/custom_columns.py b/components/antd/table/demos/custom_columns.py
deleted file mode 100644
index 0383b34056939c4abba364548c8b7c30026e35db..0000000000000000000000000000000000000000
--- a/components/antd/table/demos/custom_columns.py
+++ /dev/null
@@ -1,84 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-data = [{
- "key": "1",
- "name": "John Brown",
- "age": 32,
- "address": "New York No. 1 Lake Park",
- "tags": ["nice", "developer"]
-}, {
- "key": "2",
- "name": "Jim Green",
- "age": 42,
- "address": "London No. 1 Lake Park",
- "tags": ["loser"]
-}, {
- "key": "3",
- "name": "Joe Black",
- "age": 32,
- "address": "Sydney No. 1 Lake Park",
- "tags": ["cool", "teacher"]
-}]
-
-
-def on_invite(e: gr.EventData):
- print(e._data)
-
-
-def on_delete(e: gr.EventData):
- print(e._data)
-
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Table(data_source=data):
- with antd.Table.Column(
- title="Name",
- data_index="name",
- key="name",
- ):
- with ms.Slot("render",
- params_mapping="(text) => ({ value: text })"):
- antd.Typography.Link(href="#")
- antd.Table.Column(title="Age", data_index="age", key="age")
- antd.Table.Column(title="Age", data_index="age", key="age")
- antd.Table.Column(title="Address",
- data_index="address",
- key="address")
- antd.Table.Column(title="Tags",
- data_index="tags",
- key="tags",
- column_render="""(_, { tags }) => {
- const React = window.ms_globals.React;
- const antd = window.ms_globals.antd;
- return tags.map((tag) => {
- let color = tag.length > 5 ? 'geekblue' : 'green';
- if (tag === 'loser') {
- color = 'volcano';
- }
- return React.createElement(antd.Tag, { color, key: tag }, tag.toUpperCase());
- });
-}""")
-
- with antd.Table.Column(
- title="Action",
- key="action",
- ):
- with ms.Slot(
- "render",
- params_mapping=
- "(_, record, index) => ({ invite: { value: 'Invite ' + record.name, index }, delete: { index }})"
- ):
- with antd.Space(size="middle"):
- antd.Button(type="primary",
- as_item="invite").click(fn=on_invite)
- antd.Button('Delete',
- type="primary",
- danger=True,
- as_item="delete").click(fn=on_delete)
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/table/demos/expandable_row.py b/components/antd/table/demos/expandable_row.py
deleted file mode 100644
index 3738c0e41e2c11167ae8c4a30408e5090759e3d0..0000000000000000000000000000000000000000
--- a/components/antd/table/demos/expandable_row.py
+++ /dev/null
@@ -1,67 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-data = [{
- "key":
- 1,
- "name":
- "John Brown",
- "age":
- 32,
- "address":
- "New York No. 1 Lake Park",
- "description":
- "My name is John Brown, I am 32 years old, living in New York No. 1 Lake Park."
-}, {
- "key":
- 2,
- "name":
- "Jim Green",
- "age":
- 42,
- "address":
- "London No. 1 Lake Park",
- "description":
- "My name is Jim Green, I am 42 years old, living in London No. 1 Lake Park."
-}, {
- "key": 3,
- "name": "Not Expandable",
- "age": 29,
- "address": "Jiangsu No. 1 Lake Park",
- "description": "This not expandable"
-}, {
- "key":
- 4,
- "name":
- "Joe Black",
- "age":
- 32,
- "address":
- "Sydney No. 1 Lake Park",
- "description":
- "My name is Joe Black, I am 32 years old, living in Sydney No. 1 Lake Park."
-}]
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Table(data_source=data):
- with ms.Slot("expandable"):
- with antd.Table.Expandable(
- row_expandable=
- """(record) => record.name !== 'Not Expandable'"""
- ):
- with ms.Slot(
- "expandedRowRender",
- """(record) => ({ value: record.description })"""
- ):
- antd.Typography.Text(type="success")
-
- antd.Table.Column(title="Name", data_index="name", key="name")
- antd.Table.Column(title="Age", data_index="age", key="age")
- antd.Table.Column(title="Address",
- data_index="address",
- key="address")
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/table/demos/order_specific_column.py b/components/antd/table/demos/order_specific_column.py
deleted file mode 100644
index ea039ac30125fa6ec4b0d13382be7d1b55a1edf3..0000000000000000000000000000000000000000
--- a/components/antd/table/demos/order_specific_column.py
+++ /dev/null
@@ -1,71 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-data = [{
- "key":
- 1,
- "name":
- "John Brown",
- "age":
- 32,
- "address":
- "New York No. 1 Lake Park",
- "description":
- "My name is John Brown, I am 32 years old, living in New York No. 1 Lake Park."
-}, {
- "key":
- 2,
- "name":
- "Jim Green",
- "age":
- 42,
- "address":
- "London No. 1 Lake Park",
- "description":
- "My name is Jim Green, I am 42 years old, living in London No. 1 Lake Park."
-}, {
- "key": 3,
- "name": "Not Expandable",
- "age": 29,
- "address": "Jiangsu No. 1 Lake Park",
- "description": "This not expandable"
-}, {
- "key":
- 4,
- "name":
- "Joe Black",
- "age":
- 32,
- "address":
- "Sydney No. 1 Lake Park",
- "description":
- "My name is Joe Black, I am 32 years old, living in Sydney No. 1 Lake Park."
-}]
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Table(data_source=data):
- with ms.Slot("rowSelection"):
- selection = antd.Table.RowSelection()
- with ms.Slot("expandable"):
- with antd.Table.Expandable(
- row_expandable=
- """(record) => record.name !== 'Not Expandable'"""
- ):
- with ms.Slot(
- "expandedRowRender",
- """(record) => ({ value: record.description })"""
- ):
- antd.Typography.Text(type="success")
-
- antd.Table.Column(title="Name", data_index="name", key="name")
- antd.Table.Column(built_in_column="EXPAND_COLUMN")
- antd.Table.Column(title="Age", data_index="age", key="age")
- antd.Table.Column(built_in_column="SELECTION_COLUMN")
- antd.Table.Column(title="Address",
- data_index="address",
- key="address")
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/table/demos/pagination.py b/components/antd/table/demos/pagination.py
deleted file mode 100644
index 2e6b5eefa2158ea062a3dae346914f08c0b6a02c..0000000000000000000000000000000000000000
--- a/components/antd/table/demos/pagination.py
+++ /dev/null
@@ -1,29 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-data = [{
- "key": f"{i}",
- "name": f'Item {i}',
- "age": 32,
- "address": '10 Downing Street',
-} for i in range(20)]
-
-
-def on_change(e: gr.EventData):
- print(e._data)
-
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Table(data_source=data,
- pagination=dict(pageSize=4)) as table:
- antd.Table.Column(title="Name", data_index="name", key="name")
- antd.Table.Column(title="Age", data_index="age", key="age")
- antd.Table.Column(title="Address",
- data_index="address",
- key="address")
- table.change(fn=on_change)
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/table/demos/selection.py b/components/antd/table/demos/selection.py
deleted file mode 100644
index 173a989187b6eb92c397f6e03a5347a2f479fb1a..0000000000000000000000000000000000000000
--- a/components/antd/table/demos/selection.py
+++ /dev/null
@@ -1,56 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-data = [
- {
- "key": '1',
- "name": 'Mike',
- "age": 32,
- "address": '10 Downing Street',
- },
- {
- "key": '2',
- "name": 'John',
- "age": 42,
- "address": '10 Downing Street',
- },
-]
-
-
-def on_selection_change(e: gr.EventData):
- print(e._data)
-
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Table(data_source=data):
- # add selection config
- with ms.Slot("rowSelection"):
- selection = antd.Table.RowSelection()
- antd.Table.Column(title="Name", data_index="name", key="name")
- antd.Table.Column(title="Age", data_index="age", key="age")
- antd.Table.Column(title="Address",
- data_index="address",
- key="address")
- selection.change(on_selection_change)
- antd.Divider("Custom selection")
- with antd.Table(data_source=data):
- # add selection config
- with ms.Slot("rowSelection"):
- with antd.Table.RowSelection():
- with ms.Slot("selections"):
- antd.Table.RowSelection.Selection(
- built_in_selection='SELECT_ALL')
- antd.Table.RowSelection.Selection(
- built_in_selection='SELECT_INVERT')
- antd.Table.RowSelection.Selection(
- built_in_selection='SELECT_NONE')
- antd.Table.Column(title="Name", data_index="name", key="name")
- antd.Table.Column(title="Age", data_index="age", key="age")
- antd.Table.Column(title="Address",
- data_index="address",
- key="address")
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/tabs/README-zh_CN.md b/components/antd/tabs/README-zh_CN.md
deleted file mode 100644
index 82342642e9dd9ea1ea242fb1967ac5871d2da009..0000000000000000000000000000000000000000
--- a/components/antd/tabs/README-zh_CN.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# Tabs
-
-Tabs make it easy to explore and switch between different views. See [Ant Design](https://ant.design/components/tabs/) for more information.
-
-## Examples
-
-
-
diff --git a/components/antd/tabs/README.md b/components/antd/tabs/README.md
deleted file mode 100644
index 82342642e9dd9ea1ea242fb1967ac5871d2da009..0000000000000000000000000000000000000000
--- a/components/antd/tabs/README.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# Tabs
-
-Tabs make it easy to explore and switch between different views. See [Ant Design](https://ant.design/components/tabs/) for more information.
-
-## Examples
-
-
-
diff --git a/components/antd/tabs/app.py b/components/antd/tabs/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/tabs/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/tabs/demos/basic.py b/components/antd/tabs/demos/basic.py
deleted file mode 100644
index 6607f1f81a0c6b2577faa5e67617f3d3bd88d17e..0000000000000000000000000000000000000000
--- a/components/antd/tabs/demos/basic.py
+++ /dev/null
@@ -1,31 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Tabs(default_active_key='1'):
- with antd.Tabs.Item(key="1", label="Tab1"):
- ms.Text("Tab 1")
- with antd.Tabs.Item(key="2", label="Tab2", disabled=True):
- ms.Text("Tab 2")
- with antd.Tabs.Item(key="3", label="Tab3"):
- ms.Text("Tab 3")
- with ms.Slot("icon"):
- antd.Icon("AndroidOutlined")
- antd.Divider("Extra content")
- with antd.Tabs(default_active_key='1'):
- with ms.Slot("tabBarExtraContent.left"):
- antd.Button("Left Extra Action")
- with ms.Slot("tabBarExtraContent.right"):
- antd.Button("Right Extra Action")
- with antd.Tabs.Item(key="1", label="Tab1"):
- ms.Text("Tab 1")
- with antd.Tabs.Item(key="2", label="Tab2"):
- ms.Text("Tab 2")
- with antd.Tabs.Item(key="3", label="Tab3"):
- ms.Text("Tab 3")
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/tabs/demos/position.py b/components/antd/tabs/demos/position.py
deleted file mode 100644
index c937bdfddc379fe4a5447920af243560192585bc..0000000000000000000000000000000000000000
--- a/components/antd/tabs/demos/position.py
+++ /dev/null
@@ -1,28 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-default_position = "top"
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Space():
- ms.Text("Tab position")
- position = antd.Radio.Group(
- value=default_position,
- option_type="button",
- options=["top", "left", "right", "bottom"])
- with antd.Tabs(default_active_key='1') as tabs:
- with antd.Tabs.Item(key="1", label="Tab1"):
- ms.Text("Tab 1")
- with antd.Tabs.Item(key="2", label="Tab2"):
- ms.Text("Tab 2")
- with antd.Tabs.Item(key="3", label="Tab3"):
- ms.Text("Tab 3")
- position.change(fn=lambda x: gr.update(tab_position=x),
- inputs=[position],
- outputs=[tabs])
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/tag/README-zh_CN.md b/components/antd/tag/README-zh_CN.md
deleted file mode 100644
index ff43eb834d7da65d60c945a2fd1045eaad306100..0000000000000000000000000000000000000000
--- a/components/antd/tag/README-zh_CN.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# Tag
-
-Used for marking and categorization. See [Ant Design](https://ant.design/components/tag/) for more information.
-
-## Examples
-
-
-
diff --git a/components/antd/tag/README.md b/components/antd/tag/README.md
deleted file mode 100644
index ff43eb834d7da65d60c945a2fd1045eaad306100..0000000000000000000000000000000000000000
--- a/components/antd/tag/README.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# Tag
-
-Used for marking and categorization. See [Ant Design](https://ant.design/components/tag/) for more information.
-
-## Examples
-
-
-
diff --git a/components/antd/tag/app.py b/components/antd/tag/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/tag/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/tag/demos/basic.py b/components/antd/tag/demos/basic.py
deleted file mode 100644
index 3a682248a90f58824287b4161d6692037044460d..0000000000000000000000000000000000000000
--- a/components/antd/tag/demos/basic.py
+++ /dev/null
@@ -1,59 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Space(size="small"):
- antd.Tag("Tag1")
- with antd.Tag():
- antd.Typography.Link(
- "Link",
- href=
- "https://github.com/ant-design/ant-design/issues/1862")
- antd.Tag('Closeable', close_icon=True)
- with antd.Tag():
- with ms.Slot("closeIcon"):
- antd.Icon("CloseCircleOutlined",
- elem_style=dict(fontSize=14,
- marginLeft="4px"))
- ms.Text("Custom Close Icon")
- with antd.Divider(orientation="left"):
- ms.Text("Icon Tag")
- with antd.Flex(gap=("4px", "0"), wrap=True):
- with antd.Tag(color="#55acee"):
- ms.Text("Twitter")
- with antd.Tag(color="#cd201f"):
- ms.Text("Youtube")
- with antd.Tag(color="#3b5999"):
- ms.Text("Facebook")
- with antd.Tag(color="#55acee"):
- ms.Text("LinkedIn")
-
- with antd.Divider(orientation="left"):
- ms.Text("Presets Colorful Tag")
-
- with antd.Flex(gap=("4px", "0"), wrap=True):
- antd.Tag("magenta", color="magenta")
- antd.Tag("red", color="red")
- antd.Tag("volcano", color="volcano")
- antd.Tag("orange", color="orange")
- antd.Tag("gold", color="gold")
- antd.Tag("lime", color="lime")
- antd.Tag("green", color="green")
- antd.Tag("cyan", color="cyan")
- antd.Tag("blue", color="blue")
- antd.Tag("geekblue", color="geekblue")
- antd.Tag("purple", color="purple")
-
- with antd.Divider(orientation="left"):
- ms.Text("Custom Colorful Tag")
-
- with antd.Flex(gap="4px 0", wrap=True):
- antd.Tag("#f50", color="#f50")
- antd.Tag("#2db7f5", color="#2db7f5")
- antd.Tag("#87d068", color="#87d068")
- antd.Tag("#108ee9", color="#108ee9")
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/tag/demos/checkable_tag.py b/components/antd/tag/demos/checkable_tag.py
deleted file mode 100644
index f4a64d947f0a722f26bd2a058be5bee857fdb0dd..0000000000000000000000000000000000000000
--- a/components/antd/tag/demos/checkable_tag.py
+++ /dev/null
@@ -1,18 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-default_position = "top"
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Flex(gap=4, wrap=True, align="center"):
- ms.Span("Categories:")
- antd.Tag.CheckableTag("Movies", value=True)
- antd.Tag.CheckableTag("Books")
- antd.Tag.CheckableTag("Music")
- antd.Tag.CheckableTag("Sports")
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/time_picker/README-zh_CN.md b/components/antd/time_picker/README-zh_CN.md
deleted file mode 100644
index 94521170633e17ecd0cd208fbfa7500fc875bb78..0000000000000000000000000000000000000000
--- a/components/antd/time_picker/README-zh_CN.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# TimePicker
-
-To select/input a time. See [Ant Design](https://ant.design/components/time-picker/) for more information.
-
-## Examples
-
-
-
diff --git a/components/antd/time_picker/README.md b/components/antd/time_picker/README.md
deleted file mode 100644
index 94521170633e17ecd0cd208fbfa7500fc875bb78..0000000000000000000000000000000000000000
--- a/components/antd/time_picker/README.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# TimePicker
-
-To select/input a time. See [Ant Design](https://ant.design/components/time-picker/) for more information.
-
-## Examples
-
-
-
diff --git a/components/antd/time_picker/app.py b/components/antd/time_picker/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/time_picker/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/time_picker/demos/basic.py b/components/antd/time_picker/demos/basic.py
deleted file mode 100644
index 5dc3c66ae769c48095b8b35c104ba75fbdf2d723..0000000000000000000000000000000000000000
--- a/components/antd/time_picker/demos/basic.py
+++ /dev/null
@@ -1,31 +0,0 @@
-import time
-
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Space(direction='vertical'):
- antd.TimePicker()
- antd.TimePicker(format="HH:mm")
- antd.TimePicker(minute_step=15,
- second_step=10,
- hour_step=1,
- need_confirm=True)
- antd.Divider("12 hours")
- with antd.Space(direction='vertical'):
- antd.TimePicker(use_12_hours=True)
- antd.TimePicker(use_12_hours=True, format="h:mm:ss A")
- antd.TimePicker(use_12_hours=True, format="h:mm a")
- antd.Divider("Prefix and Suffix")
- with antd.Space(direction='vertical'):
- with antd.TimePicker():
- with ms.Slot("suffixIcon"):
- antd.Icon("SmileOutlined")
- with antd.TimePicker():
- with ms.Slot("prefix"):
- antd.Icon("SmileOutlined")
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/time_picker/demos/range_picker.py b/components/antd/time_picker/demos/range_picker.py
deleted file mode 100644
index 315483d4bf83510a4d1804952adac529406c9f13..0000000000000000000000000000000000000000
--- a/components/antd/time_picker/demos/range_picker.py
+++ /dev/null
@@ -1,13 +0,0 @@
-import time
-
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- antd.TimePicker.RangePicker(
- value=lambda: [time.time(), time.time()], format="HH:mm:ss")
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/timeline/README-zh_CN.md b/components/antd/timeline/README-zh_CN.md
deleted file mode 100644
index 2c09103561fbcf60727951939f6cbcf1eb327bc9..0000000000000000000000000000000000000000
--- a/components/antd/timeline/README-zh_CN.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Timeline
-
-Vertical display timeline. See [Ant Design](https://ant.design/components/timeline/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/timeline/README.md b/components/antd/timeline/README.md
deleted file mode 100644
index 2c09103561fbcf60727951939f6cbcf1eb327bc9..0000000000000000000000000000000000000000
--- a/components/antd/timeline/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Timeline
-
-Vertical display timeline. See [Ant Design](https://ant.design/components/timeline/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/timeline/app.py b/components/antd/timeline/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/timeline/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/timeline/demos/basic.py b/components/antd/timeline/demos/basic.py
deleted file mode 100644
index 9c444d759c6b6ba97bf31d21baf4c46f83bed89f..0000000000000000000000000000000000000000
--- a/components/antd/timeline/demos/basic.py
+++ /dev/null
@@ -1,40 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Timeline():
- with antd.Timeline.Item():
- ms.Text("Create a services site 2015-09-01")
- with antd.Timeline.Item():
- ms.Text("Solve initial network problems 2015-09-01")
- with antd.Timeline.Item():
- ms.Text("Technical testing 2015-09-01")
- with antd.Timeline.Item():
- ms.Text("Network problems being solved 2015-09-01")
- antd.Divider("Alternate")
- with antd.Timeline(mode="alternate"):
- with antd.Timeline.Item():
- ms.Text("Create a services site 2015-09-01")
- with antd.Timeline.Item(color="green"):
- ms.Text("Solve initial network problems 2015-09-01")
- with antd.Timeline.Item():
- ms.Text(
- "Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo."
- )
- with ms.Slot("dot"):
- antd.Icon("ClockCircleOutlined",
- elem_style=dict(fontSize=16))
- with antd.Timeline.Item(color="red"):
- ms.Text("Network problems being solved 2015-09-01")
- with antd.Timeline.Item():
- ms.Text("Create a services site 2015-09-01")
- with antd.Timeline.Item():
- with ms.Slot("dot"):
- antd.Icon("ClockCircleOutlined",
- elem_style=dict(fontSize=16))
- ms.Text("Technical testing 2015-09-01")
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/tooltip/README-zh_CN.md b/components/antd/tooltip/README-zh_CN.md
deleted file mode 100644
index 3b1fd2619ada3c4816560150abcd93ce9c009e05..0000000000000000000000000000000000000000
--- a/components/antd/tooltip/README-zh_CN.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Tooltip
-
-Simple text popup box. See [Ant Design](https://ant.design/components/tooltip/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/tooltip/README.md b/components/antd/tooltip/README.md
deleted file mode 100644
index 3b1fd2619ada3c4816560150abcd93ce9c009e05..0000000000000000000000000000000000000000
--- a/components/antd/tooltip/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Tooltip
-
-Simple text popup box. See [Ant Design](https://ant.design/components/tooltip/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/tooltip/app.py b/components/antd/tooltip/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/tooltip/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/tooltip/demos/basic.py b/components/antd/tooltip/demos/basic.py
deleted file mode 100644
index 1515d2be590c7b0c0d0d26e148d58072c141b79b..0000000000000000000000000000000000000000
--- a/components/antd/tooltip/demos/basic.py
+++ /dev/null
@@ -1,16 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Space(direction="vertical"):
- with antd.Tooltip(title="prompt text"):
- ms.Span("Tooltip will show on mouse enter.")
- with antd.Tooltip():
- with ms.Slot("title"):
- antd.Typography.Text("prompt text", type="success")
- ms.Span("Custom Title")
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/tour/README-zh_CN.md b/components/antd/tour/README-zh_CN.md
deleted file mode 100644
index be9e064c590fa801c4bc571df0a2fe21747ffd2e..0000000000000000000000000000000000000000
--- a/components/antd/tour/README-zh_CN.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Tour
-
-A popup component for guiding users through a product. See [Ant Design](https://ant.design/components/tour/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/tour/README.md b/components/antd/tour/README.md
deleted file mode 100644
index be9e064c590fa801c4bc571df0a2fe21747ffd2e..0000000000000000000000000000000000000000
--- a/components/antd/tour/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Tour
-
-A popup component for guiding users through a product. See [Ant Design](https://ant.design/components/tour/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/tour/app.py b/components/antd/tour/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/tour/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/tour/demos/basic.py b/components/antd/tour/demos/basic.py
deleted file mode 100644
index de44c63b0d8bec18f75c0fdd68661b73d38551a0..0000000000000000000000000000000000000000
--- a/components/antd/tour/demos/basic.py
+++ /dev/null
@@ -1,37 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- btn = antd.Button("Begin Tour",
- type="primary",
- elem_id="tour-begin-btn")
- with antd.Tour(open=False) as tour:
- antd.Tour.Step(
- title="Center",
- description="Displayed in the center of screen.",
- get_target=None)
- antd.Tour.Step(
- title="Right",
- description="On the right of target.",
- get_target=
- "() => document.querySelector('#tour-begin-btn')",
- placement="right")
- with antd.Tour.Step(
- title="Top",
- get_target=
- "() => document.querySelector('#tour-begin-btn')",
- placement="top"):
- with ms.Slot("description"):
- antd.Typography.Text("On the top of target.",
- type="success")
-
- btn.click(lambda: gr.update(open=True), outputs=[tour])
- gr.on([tour.close, tour.finish],
- lambda: gr.update(open=False),
- outputs=[tour])
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/transfer/README-zh_CN.md b/components/antd/transfer/README-zh_CN.md
deleted file mode 100644
index 56b8440c0bcf9f2ad688fa836a6a61d0ad0a8524..0000000000000000000000000000000000000000
--- a/components/antd/transfer/README-zh_CN.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Transfer
-
-Double column transfer choice box. See [Ant Design](https://ant.design/components/transfer/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/transfer/README.md b/components/antd/transfer/README.md
deleted file mode 100644
index 56b8440c0bcf9f2ad688fa836a6a61d0ad0a8524..0000000000000000000000000000000000000000
--- a/components/antd/transfer/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Transfer
-
-Double column transfer choice box. See [Ant Design](https://ant.design/components/transfer/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/transfer/app.py b/components/antd/transfer/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/transfer/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/transfer/demos/basic.py b/components/antd/transfer/demos/basic.py
deleted file mode 100644
index 69bf1c922158769b4f80291e80e34e908c4eb128..0000000000000000000000000000000000000000
--- a/components/antd/transfer/demos/basic.py
+++ /dev/null
@@ -1,40 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-mock_data = [{
- "key": str(i),
- "title": f"content{i + 1}",
- "description": f"description of content{i + 1}"
-} for i in range(20)]
-
-initial_target_keys = [
- item['key'] for item in mock_data if int(item['key']) > 10
-]
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Transfer(value=initial_target_keys,
- data_source=mock_data,
- titles=['Source', 'Target']):
- # custom render items
- with ms.Slot("render", params_mapping="(item) => item.title"):
- antd.Typography.Text(type="success")
-
- antd.Divider("One Way")
- antd.Transfer(one_way=True,
- data_source=mock_data,
- titles=['Source', 'Target'])
- antd.Divider("Search")
- antd.Transfer(
- value=initial_target_keys,
- show_search=True,
- # use javascript function to filter options
- filter_option=
- "(inputValue, option) => option.description.indexOf(inputValue) > -1",
- data_source=mock_data,
- titles=['Source', 'Target'])
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/tree/README-zh_CN.md b/components/antd/tree/README-zh_CN.md
deleted file mode 100644
index 9ead8c07a558ac6b103c592a59e117d6d57be0df..0000000000000000000000000000000000000000
--- a/components/antd/tree/README-zh_CN.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# Tree
-
-Multiple-level structure list. See [Ant Design](https://ant.design/components/tree/) for more information.
-
-## Examples
-
-
-
diff --git a/components/antd/tree/README.md b/components/antd/tree/README.md
deleted file mode 100644
index 9ead8c07a558ac6b103c592a59e117d6d57be0df..0000000000000000000000000000000000000000
--- a/components/antd/tree/README.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# Tree
-
-Multiple-level structure list. See [Ant Design](https://ant.design/components/tree/) for more information.
-
-## Examples
-
-
-
diff --git a/components/antd/tree/app.py b/components/antd/tree/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/tree/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/tree/demos/basic.py b/components/antd/tree/demos/basic.py
deleted file mode 100644
index 4078ebc8ba077bd4796ad64b543fd604c48c3707..0000000000000000000000000000000000000000
--- a/components/antd/tree/demos/basic.py
+++ /dev/null
@@ -1,82 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-tree_data = [{
- "title":
- "parent 1",
- "key":
- "0-0",
- "children": [{
- "title":
- "parent 1-0",
- "key":
- "0-0-0",
- "disabled":
- True,
- "children": [{
- "title": "leaf",
- "key": "0-0-0-0",
- "disableCheckbox": True
- }, {
- "title": "leaf",
- "key": "0-0-0-1"
- }]
- }, {
- "title": "parent 1-1",
- "key": "0-0-1",
- "children": [{
- "title": "sss",
- "key": "0-0-1-0"
- }]
- }]
-}]
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- antd.Tree(elem_style=dict(width="100%"),
- checkable=True,
- default_checked_keys=['0-0-0', '0-0-1'],
- default_selected_keys=['0-0-0', '0-0-1'],
- default_expanded_keys=['0-0-0', '0-0-1'],
- tree_data=tree_data)
- antd.Divider("Custom TreeNode")
- with antd.Tree(show_line=True,
- show_icon=True,
- default_expanded_keys=['parent-1', 'parent-1-0'],
- elem_style=dict(width=300)):
- with ms.Slot("treeData"):
- with antd.Tree.TreeNode(key="parent-1", title="parent 1"):
- with ms.Slot("icon"):
- antd.Icon("CarryOutOutlined")
- with antd.Tree.TreeNode(key="parent-1-0",
- title="parent 1-0"):
- with ms.Slot("icon"):
- antd.Icon("CarryOutOutlined")
- with antd.Tree.TreeNode(key="leaf1",
- title="leaf1"):
- with ms.Slot("icon"):
- antd.Icon("CarryOutOutlined")
- with antd.Tree.TreeNode(key="leaf2",
- title="leaf2"):
- with ms.Slot("icon"):
- antd.Icon("CarryOutOutlined")
- with antd.Tree.TreeNode(key="leaf3",
- title="leaf3"):
- with ms.Slot("icon"):
- antd.Icon("CarryOutOutlined")
- with antd.Tree.TreeNode(
- key="parent-1-1",
- title="parent 1-1",
- ):
- with ms.Slot("icon"):
- antd.Icon("CarryOutOutlined")
- with antd.Tree.TreeNode(key="leaf11"):
- with ms.Slot("title"):
- antd.Typography.Text("leaf11",
- type="success")
- with ms.Slot("icon"):
- antd.Icon("CarryOutOutlined")
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/tree/demos/directory_tree.py b/components/antd/tree/demos/directory_tree.py
deleted file mode 100644
index 285e633d3593511f509b2853db69edf28a0bf0cb..0000000000000000000000000000000000000000
--- a/components/antd/tree/demos/directory_tree.py
+++ /dev/null
@@ -1,44 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-tree_data = [{
- "title":
- "parent 0",
- "key":
- "0-0",
- "children": [{
- "title": "leaf 0-0",
- "key": "0-0-0",
- "isLeaf": True
- }, {
- "title": "leaf 0-1",
- "key": "0-0-1",
- "isLeaf": True
- }]
-}, {
- "title":
- "parent 1",
- "key":
- "0-1",
- "children": [{
- "title": "leaf 1-0",
- "key": "0-1-0",
- "isLeaf": True
- }, {
- "title": "leaf 1-1",
- "key": "0-1-1",
- "isLeaf": True
- }]
-}]
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- antd.Tree.DirectoryTree(draggable=True,
- multiple=True,
- default_expand_all=True,
- tree_data=tree_data)
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/tree_select/README-zh_CN.md b/components/antd/tree_select/README-zh_CN.md
deleted file mode 100644
index d90241015db3bb4bd6802cf6d191692cd7683fa6..0000000000000000000000000000000000000000
--- a/components/antd/tree_select/README-zh_CN.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# TreeSelect
-
-Tree selection control. See [Ant Design](https://ant.design/components/tree-select/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/tree_select/README.md b/components/antd/tree_select/README.md
deleted file mode 100644
index d90241015db3bb4bd6802cf6d191692cd7683fa6..0000000000000000000000000000000000000000
--- a/components/antd/tree_select/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# TreeSelect
-
-Tree selection control. See [Ant Design](https://ant.design/components/tree-select/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/tree_select/app.py b/components/antd/tree_select/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/tree_select/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/tree_select/demos/basic.py b/components/antd/tree_select/demos/basic.py
deleted file mode 100644
index 488a369910881a9b43e35b77ede4c3cf77136b85..0000000000000000000000000000000000000000
--- a/components/antd/tree_select/demos/basic.py
+++ /dev/null
@@ -1,95 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-tree_data = [{
- "value":
- "parent 1",
- "title":
- "parent 1",
- "children": [{
- "value":
- "parent 1-0",
- "title":
- "parent 1-0",
- "children": [{
- "value": "leaf1",
- "title": "leaf1"
- }, {
- "value": "leaf2",
- "title": "leaf2"
- }, {
- "value": "leaf3",
- "title": "leaf3"
- }, {
- "value": "leaf4",
- "title": "leaf4"
- }, {
- "value": "leaf5",
- "title": "leaf5"
- }, {
- "value": "leaf6",
- "title": "leaf6"
- }]
- }, {
- "value": "parent 1-1",
- "title": "parent 1-1",
- "children": [{
- "value": "leaf11",
- "title": "leaf11"
- }]
- }]
-}]
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- antd.TreeSelect(show_search=True,
- elem_style=dict(width="100%"),
- dropdown_style=dict(maxHeight=400,
- overflow="auto"),
- multiple=True,
- placeholder="Please Select",
- tree_checkable=True,
- show_checked_strategy="SHOW_PARENT",
- tree_default_expand_all=True,
- tree_data=tree_data)
- antd.Divider("Custom TreeNode")
- with antd.TreeSelect(tree_line=True,
- tree_icon=True,
- elem_style=dict(width=300)):
- with ms.Slot("treeData"):
- with antd.TreeSelect.TreeNode(value="parent 1",
- title="parent 1"):
- with ms.Slot("icon"):
- antd.Icon("CarryOutOutlined")
- with antd.TreeSelect.TreeNode(value="parent 1-0",
- title="parent 1-0"):
- with ms.Slot("icon"):
- antd.Icon("CarryOutOutlined")
- with antd.TreeSelect.TreeNode(value="leaf1",
- title="leaf1"):
- with ms.Slot("icon"):
- antd.Icon("CarryOutOutlined")
- with antd.TreeSelect.TreeNode(value="leaf2",
- title="leaf2"):
- with ms.Slot("icon"):
- antd.Icon("CarryOutOutlined")
- with antd.TreeSelect.TreeNode(value="leaf3",
- title="leaf3"):
- with ms.Slot("icon"):
- antd.Icon("CarryOutOutlined")
- with antd.TreeSelect.TreeNode(
- value="parent 1-1",
- title="parent 1-1",
- ):
- with ms.Slot("icon"):
- antd.Icon("CarryOutOutlined")
- with antd.TreeSelect.TreeNode(value="leaf11"):
- with ms.Slot("title"):
- antd.Typography.Text("leaf11",
- type="success")
- with ms.Slot("icon"):
- antd.Icon("CarryOutOutlined")
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/typography/README-zh_CN.md b/components/antd/typography/README-zh_CN.md
deleted file mode 100644
index 809ae8666c9cfd82e65f63069bd05cc9e8bbff90..0000000000000000000000000000000000000000
--- a/components/antd/typography/README-zh_CN.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Button
-
-See [Ant Design](https://ant.design/components/float-button/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/typography/README.md b/components/antd/typography/README.md
deleted file mode 100644
index cefa66ef6d080eff86e8bb4061ca18531de7011f..0000000000000000000000000000000000000000
--- a/components/antd/typography/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Typography
-
-Basic text writing, including headings, body text, lists, and more. See [Ant Design](https://ant.design/components/typography/) for more information.
-
-## Examples
-
-
diff --git a/components/antd/typography/app.py b/components/antd/typography/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/typography/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/typography/demos/basic.py b/components/antd/typography/demos/basic.py
deleted file mode 100644
index a663d68b5e2a9bfd8c0fabbfe7b4154050b6dda5..0000000000000000000000000000000000000000
--- a/components/antd/typography/demos/basic.py
+++ /dev/null
@@ -1,22 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-
-def on_edit(e: gr.EventData):
- return gr.update(value=e._data["payload"][0])
-
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- antd.Typography.Title("Hello, World!", level=3)
- antd.Typography.Text("Hello, World!", disabled=True)
- antd.Typography.Text("Hello, World!", type="danger")
- antd.Typography.Paragraph('This is a copyable text.',
- copyable=True)
- p = antd.Typography.Paragraph('This is an editable text.')
- p.editable_change(on_edit, outputs=[p])
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/upload/README-zh_CN.md b/components/antd/upload/README-zh_CN.md
deleted file mode 100644
index d2559b7337932cd4bb970652e6825de50f46a3cd..0000000000000000000000000000000000000000
--- a/components/antd/upload/README-zh_CN.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# Upload
-
-Used to select and upload files or drag and drop files. See [Ant Design](https://ant.design/components/upload/) for more information.
-
-## Examples
-
-
-
diff --git a/components/antd/upload/README.md b/components/antd/upload/README.md
deleted file mode 100644
index d2559b7337932cd4bb970652e6825de50f46a3cd..0000000000000000000000000000000000000000
--- a/components/antd/upload/README.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# Upload
-
-Used to select and upload files or drag and drop files. See [Ant Design](https://ant.design/components/upload/) for more information.
-
-## Examples
-
-
-
diff --git a/components/antd/upload/app.py b/components/antd/upload/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/upload/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/upload/demos/avatar.py b/components/antd/upload/demos/avatar.py
deleted file mode 100644
index 235095d71daf8b9ffbf328514629610f5da80282..0000000000000000000000000000000000000000
--- a/components/antd/upload/demos/avatar.py
+++ /dev/null
@@ -1,30 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Upload(list_type="picture-card",
- max_count=1,
- show_upload_list=False,
- accept="image/*") as upload:
- image = antd.Image(elem_style=dict(width="100%"),
- preview=False,
- visible=False)
- with ms.Div(visible=True) as btn:
- antd.Icon("PlusOutlined")
- ms.Div("Upload", elem_style=dict(marginTop=8))
-
- def on_change(_upload):
- return gr.update(value=[]), gr.update(
- visible=True,
- value=None if not _upload else _upload[0]), gr.update(
- visible=False)
-
- upload.change(fn=on_change,
- inputs=[upload],
- outputs=[upload, image, btn])
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/upload/demos/basic.py b/components/antd/upload/demos/basic.py
deleted file mode 100644
index 33a4d77a0e3cf161bbdeab5d3d4c47dd7c4ab00f..0000000000000000000000000000000000000000
--- a/components/antd/upload/demos/basic.py
+++ /dev/null
@@ -1,34 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Upload(multiple=True) as upload:
- with antd.Button():
- ms.Text("Click to Upload")
- with ms.Slot("icon"):
- antd.Icon("UploadOutlined")
- upload.change(fn=lambda _upload: print(_upload), inputs=[upload])
- antd.Divider("Pictures with list style")
- with antd.Upload(multiple=True,
- max_count=3,
- list_type="picture",
- accept="image/*"):
- with antd.Button(type="primary"):
- ms.Text("Upload (Max: 3)")
- with ms.Slot("icon"):
- antd.Icon("UploadOutlined")
- antd.Divider("Drag and Drop")
- with antd.Upload.Dragger(multiple=True):
- with ms.Div(elem_style=dict(fontSize=40, color="#1677ff")):
- antd.Icon("InboxOutlined")
- antd.Typography.Paragraph(
- "Click or drag file to this area to upload")
- antd.Typography.Paragraph(
- "Support for a single or bulk upload. Strictly prohibited from uploading company data or other banned files.",
- type="secondary")
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/watermark/README-zh_CN.md b/components/antd/watermark/README-zh_CN.md
deleted file mode 100644
index d59676829191d35cd342e403368c161febd4d2d8..0000000000000000000000000000000000000000
--- a/components/antd/watermark/README-zh_CN.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# Watermark
-
-Add specific text or patterns to the page. See [Ant Design](https://ant.design/components/watermark/) for more information.
-
-## Examples
-
-
-
diff --git a/components/antd/watermark/README.md b/components/antd/watermark/README.md
deleted file mode 100644
index d59676829191d35cd342e403368c161febd4d2d8..0000000000000000000000000000000000000000
--- a/components/antd/watermark/README.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# Watermark
-
-Add specific text or patterns to the page. See [Ant Design](https://ant.design/components/watermark/) for more information.
-
-## Examples
-
-
-
diff --git a/components/antd/watermark/app.py b/components/antd/watermark/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antd/watermark/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antd/watermark/demos/basic.py b/components/antd/watermark/demos/basic.py
deleted file mode 100644
index 1d1d20931eef60406a354563c0018aa3e3a78681..0000000000000000000000000000000000000000
--- a/components/antd/watermark/demos/basic.py
+++ /dev/null
@@ -1,22 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Flex(vertical=True, gap="small"):
- with antd.Watermark(content="Ant Design"):
- antd.Card(elem_style=dict(height=200))
- with antd.Watermark(content=['Ant Design', 'Happy Working']):
- antd.Card(elem_style=dict(height=200))
- with antd.Watermark(
- height=30,
- width=130,
- image=
- "https://mdn.alipayobjects.com/huamei_7uahnr/afts/img/A*lkAoRbywo0oAAAAAAAAAAAAADrJ8AQ/original"
- ):
- antd.Card(elem_style=dict(height=200))
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antd/watermark/demos/modal_or_drawer.py b/components/antd/watermark/demos/modal_or_drawer.py
deleted file mode 100644
index 0c2e22eda2c7ba51960263c8a72f625755b2d934..0000000000000000000000000000000000000000
--- a/components/antd/watermark/demos/modal_or_drawer.py
+++ /dev/null
@@ -1,29 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Flex(gap="middle"):
- btn = antd.Button("Open Modal", type="primary")
- btn2 = antd.Button("Open Drawer", type="primary")
- with antd.Watermark(content="Ant Design"):
- with antd.Modal(open=False, title="Basic Modal") as modal:
- antd.Typography.Paragraph("Some contents...")
- antd.Typography.Paragraph("Some contents...")
- antd.Typography.Paragraph("Some contents...")
-
- modal.ok(lambda: gr.update(open=False), outputs=[modal])
- modal.cancel(lambda: gr.update(open=False), outputs=[modal])
- with antd.Watermark(content="Ant Design"):
- with antd.Drawer(open=False, title="Basic Drawer") as drawer:
- antd.Typography.Paragraph("Some contents...")
- antd.Typography.Paragraph("Some contents...")
- antd.Typography.Paragraph("Some contents...")
- drawer.close(lambda: gr.update(open=False), outputs=[drawer])
- btn.click(lambda: gr.update(open=True), outputs=[modal])
- btn2.click(lambda: gr.update(open=True), outputs=[drawer])
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antdx/attachments/README-zh_CN.md b/components/antdx/attachments/README-zh_CN.md
deleted file mode 100644
index 75f8789144ee308d755ce3e9ad7b1a76a87141c6..0000000000000000000000000000000000000000
--- a/components/antdx/attachments/README-zh_CN.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# Attachments
-
-Display the collection of attachment information. See [Ant Design X](https://x.ant.design/components/attachments/) for more information.
-
-## Examples
-
-
-
-
diff --git a/components/antdx/attachments/README.md b/components/antdx/attachments/README.md
deleted file mode 100644
index 75f8789144ee308d755ce3e9ad7b1a76a87141c6..0000000000000000000000000000000000000000
--- a/components/antdx/attachments/README.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# Attachments
-
-Display the collection of attachment information. See [Ant Design X](https://x.ant.design/components/attachments/) for more information.
-
-## Examples
-
-
-
-
diff --git a/components/antdx/attachments/app.py b/components/antdx/attachments/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antdx/attachments/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antdx/attachments/demos/basic.py b/components/antdx/attachments/demos/basic.py
deleted file mode 100644
index 7a57c0b3767097ba836f2e1d687769c3a7794e5b..0000000000000000000000000000000000000000
--- a/components/antdx/attachments/demos/basic.py
+++ /dev/null
@@ -1,50 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.antdx as antdx
-import modelscope_studio.components.base as ms
-
-
-def upload_file(attachments_value):
- print(attachments_value)
-
-
-default_fullscreen_drop = False
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antdx.XProvider():
- with antd.Flex(vertical=True,
- gap="middle",
- align="flex-start",
- elem_id="attachments-container"):
- fullscreen_drop_switch = antd.Switch(
- value=default_fullscreen_drop,
- checked_children="Full screen drop",
- un_checked_children="Full screen drop")
- with antdx.Sender():
- with ms.Slot("prefix"):
- with antdx.Attachments(
- placeholder=dict(
- title="Drag & Drop files here",
- description=
- "Support file type: image, video, audio, document, etc."
- ),
- get_drop_container=
- "() => document.querySelector('#attachments-container')",
- ) as attachments:
- with antd.Button(value=None, type="text"):
- with ms.Slot("icon"):
- antd.Icon("LinkOutlined")
- with ms.Slot("placeholder.icon"):
- antd.Icon("CloudUploadOutlined")
-
- attachments.change(fn=upload_file, inputs=[attachments])
- fullscreen_drop_switch.change(fn=lambda x: gr.update(
- get_drop_container="() => document.body" if x else
- "() => document.querySelector('#attachments-container')",
- ),
- inputs=[fullscreen_drop_switch],
- outputs=[attachments])
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antdx/attachments/demos/combination.py b/components/antdx/attachments/demos/combination.py
deleted file mode 100644
index 7ddf5c03ddb85f8b9fb4071d6757cb3d708e6e3a..0000000000000000000000000000000000000000
--- a/components/antdx/attachments/demos/combination.py
+++ /dev/null
@@ -1,74 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.antdx as antdx
-import modelscope_studio.components.base as ms
-
-
-def toggle_open(state_value, attachments_value):
- state_value["open"] = not state_value["open"]
- return gr.update(open=state_value["open"]), gr.update(
- dot=len(attachments_value) > 0 and not state_value["open"]), gr.update(
- value=state_value)
-
-
-def submit(sender_value, attachments_value):
- print(sender_value, attachments_value)
- return gr.update(value=None), gr.update(value=None), gr.update(dot=False)
-
-
-with gr.Blocks() as demo:
- state = gr.State({"open": False})
- with ms.Application():
- with antdx.XProvider():
- antd.Typography.Paragraph(
- "Work with Sender.Header to insert file into the conversation."
- )
- with antdx.Sender() as sender:
- with ms.Slot("prefix"):
- with antd.Badge(dot=False) as prefix_badge:
- with antd.Button(value=None) as prefix_button:
- with ms.Slot("icon"):
- antd.Icon("LinkOutlined")
- with ms.Slot("header"):
- with antdx.Sender.Header(title="Attachments",
- open=False,
- styles={
- "content": {
- "padding": 0,
- },
- }) as sender_header:
- with antdx.Attachments() as attachments:
- with ms.Slot(
- "placeholder.title",
- params_mapping=
- """(type) => type === 'drop' ? 'Drop file here' : 'Upload files'"""
- ):
- ms.Span()
- with ms.Slot(
- "placeholder.description",
- params_mapping=
- "(type) => ({ style: { display: type === 'drop'? 'none' : undefined } })"
- ):
- ms.Span(
- "Click or drag files to this area to upload"
- )
- with ms.Slot(
- "placeholder.icon",
- params_mapping=
- "(type) => ({ style: { display: type === 'drop'? 'none' : undefined } })"
- ):
- antd.Icon("CloudUploadOutlined")
-
- sender_header.open_change(
- fn=toggle_open,
- inputs=[state, attachments],
- outputs=[sender_header, prefix_badge, state])
- prefix_button.click(fn=toggle_open,
- inputs=[state, attachments],
- outputs=[sender_header, prefix_badge, state])
- sender.submit(fn=submit,
- inputs=[sender, attachments],
- outputs=[sender, attachments, prefix_badge])
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antdx/attachments/demos/file_card.py b/components/antdx/attachments/demos/file_card.py
deleted file mode 100644
index a5c69790e40fe00c546d8b369df98ce7bfc909b5..0000000000000000000000000000000000000000
--- a/components/antdx/attachments/demos/file_card.py
+++ /dev/null
@@ -1,71 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.antdx as antdx
-import modelscope_studio.components.base as ms
-
-file_list = [
- {
- "uid": '1',
- "name": 'excel-file.xlsx',
- "size": 111111,
- },
- {
- "uid": '2',
- "name": 'word-file.docx',
- "size": 222222,
- },
- {
- "uid": '3',
- "name": 'image-file.png',
- "size": 333333,
- },
- {
- "uid": '4',
- "name": 'pdf-file.pdf',
- "size": 444444,
- },
- {
- "uid": '5',
- "name": 'ppt-file.pptx',
- "size": 555555,
- },
- {
- "uid": '6',
- "name": 'video-file.mp4',
- "size": 666666,
- },
- {
- "uid": '7',
- "name": 'audio-file.mp3',
- "size": 777777,
- },
- {
- "uid": '8',
- "name": 'zip-file.zip',
- "size": 888888,
- },
- {
- "uid": '9',
- "name": 'markdown-file.md',
- "size": 999999,
- "description": 'Custom description here',
- },
- {
- "uid": '10',
- "name": 'image-file.png',
- "thumbUrl":
- 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
- "url":
- 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
- "size": 123456,
- },
-]
-with gr.Blocks() as demo:
- with ms.Application():
- with antdx.XProvider():
- with antd.Flex(vertical=True, gap="middle"):
- for file in file_list:
- antdx.Attachments.FileCard(item=file)
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antdx/bubble/README-zh_CN.md b/components/antdx/bubble/README-zh_CN.md
deleted file mode 100644
index dfb34686b294cf2e843603db55082b4b7f6d6e5f..0000000000000000000000000000000000000000
--- a/components/antdx/bubble/README-zh_CN.md
+++ /dev/null
@@ -1,12 +0,0 @@
-# Bubble
-
-A bubble component for chat. See [Ant Design X](https://x.ant.design/components/bubble/) for more information.
-
-## Examples
-
-
-
-
-
-
-
diff --git a/components/antdx/bubble/README.md b/components/antdx/bubble/README.md
deleted file mode 100644
index dfb34686b294cf2e843603db55082b4b7f6d6e5f..0000000000000000000000000000000000000000
--- a/components/antdx/bubble/README.md
+++ /dev/null
@@ -1,12 +0,0 @@
-# Bubble
-
-A bubble component for chat. See [Ant Design X](https://x.ant.design/components/bubble/) for more information.
-
-## Examples
-
-
-
-
-
-
-
diff --git a/components/antdx/bubble/app.py b/components/antdx/bubble/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antdx/bubble/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antdx/bubble/demos/basic.py b/components/antdx/bubble/demos/basic.py
deleted file mode 100644
index 31763fda56b5994959fecee64cae2060fcbcb3fd..0000000000000000000000000000000000000000
--- a/components/antdx/bubble/demos/basic.py
+++ /dev/null
@@ -1,90 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.antdx as antdx
-import modelscope_studio.components.base as ms
-
-fooAvatar = {
- "color": '#f56a00',
- "backgroundColor": '#fde3cf',
-}
-
-barAvatar = {
- "color": '#fff',
- "backgroundColor": '#87d068',
-}
-
-hideAvatar = {
- "visibility": 'hidden',
-}
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antdx.XProvider():
-
- antdx.Bubble("Hello World!")
-
- antd.Divider("Placement and avatar")
- with antd.Flex(gap="middle", vertical=True):
- with antdx.Bubble(placement="start",
- content="Good morning, how are you?"):
- with ms.Slot("avatar"):
- with antd.Avatar(elem_style=fooAvatar):
- with ms.Slot("icon"):
- antd.Icon("UserOutlined")
- antdx.Bubble(placement="start",
- content="What a beautiful day!",
- avatar=dict(),
- styles={"avatar": hideAvatar})
- with antdx.Bubble(placement="end",
- content="Hi, good morning, I'm fine!"):
- with ms.Slot("avatar"):
- with antd.Avatar(elem_style=barAvatar):
- with ms.Slot("icon"):
- antd.Icon("UserOutlined")
- antdx.Bubble(placement="end",
- content="Thank you!",
- avatar=dict(),
- styles={"avatar": hideAvatar})
-
- antd.Divider("Header and footer")
-
- with antdx.Bubble(
- "Hello, welcome to use Ant Design X! Just ask if you have any questions.",
- header="Ant Design X"):
- with ms.Slot("avatar.icon"):
- antd.Icon("UserOutlined")
- with ms.Slot("footer"):
- with antd.Space(size="small"):
- with antd.Button(value=None,
- color="default",
- variant="text",
- size="small"):
- with ms.Slot("icon"):
- antd.Icon("SyncOutlined")
- with antd.Button(value=None,
- color="default",
- variant="text",
- size="small"):
- with ms.Slot("icon"):
- antd.Icon("CopyOutlined")
-
- antd.Divider("Loading")
- with antd.Space():
- ms.Span("Loading State")
- loading_switch = antd.Switch(value=False)
- with antdx.Bubble("hello world !") as loading_bubble:
- with ms.Slot("avatar.icon"):
- antd.Icon("UserOutlined")
-
- loading_switch.change(fn=lambda x: gr.update(loading=x),
- inputs=[loading_switch],
- outputs=[loading_bubble])
- antd.Divider("Markdown")
- with antdx.Bubble():
- with ms.Slot("avatar.icon"):
- antd.Icon("UserOutlined")
- with ms.Slot("content"):
- ms.Markdown("Hello `Markdown`!")
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antdx/bubble/demos/bubble_list.py b/components/antdx/bubble/demos/bubble_list.py
deleted file mode 100644
index 34e59aa56e1533dca5fa1f3dd5f02bb4bc099e29..0000000000000000000000000000000000000000
--- a/components/antdx/bubble/demos/bubble_list.py
+++ /dev/null
@@ -1,83 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.antdx as antdx
-import modelscope_studio.components.base as ms
-
-
-def get_bubble_items(count):
- result = []
- for i in range(count):
- is_ai = i % 2 != 0
- content = 'Mock AI content. ' * 20 if is_ai else f'Mock User content `{i}`.'
- result.append({
- "role": "ai" if is_ai else "user",
- "content": content,
- "key": i - 1
- })
- return result
-
-
-def add_bubble(state_value):
- state_value["history_count"] = state_value["history_count"] + 1
- return gr.update(value=state_value), gr.update(
- items=get_bubble_items(state_value["history_count"]))
-
-
-with gr.Blocks() as demo:
-
- with ms.Application():
- state = gr.State({"history_count": 3})
- with antdx.XProvider():
- antd.Typography.Paragraph(
- "Preset Bubble list. Support auto scroll. Use roles to set default properties of Bubble."
- )
- with antd.Flex(gap="small", vertical=True):
- with antd.Flex(gap="small",
- elem_style=dict(alignSelf="flex-end")):
- add_bubble_btn = antd.Button("Add Bubble")
- scroll_btn = antd.Button("Scroll To First")
- with antdx.Bubble.List(items=get_bubble_items(3),
- elem_style=dict(maxHeight=300),
- elem_id="bubble-list") as bubble_list:
- # Define Roles
- with ms.Slot("roles"):
- with antdx.Bubble.List.Role(
- role="ai",
- placement="start",
- typing=dict(step=5, interval=20),
- elem_style=dict(maxWidth=600)):
- with ms.Slot("avatar"):
- with antd.Avatar(elem_style=dict(
- backgroundColor="#fde3cf")):
- with ms.Slot("icon"):
- antd.Icon("UserOutlined")
- # use messageRender to render markdown content
- with ms.Slot(
- "messageRender",
- params_mapping="""content => content"""):
- ms.Markdown()
-
- with antdx.Bubble.List.Role(
- role="user",
- placement="end",
- ):
- with ms.Slot("avatar"):
- with antd.Avatar(elem_style=dict(
- backgroundColor="#87d068")):
- with ms.Slot("icon"):
- antd.Icon("UserOutlined")
- with ms.Slot(
- "messageRender",
- params_mapping="(content) => content"):
- ms.Markdown()
- add_bubble_btn.click(fn=add_bubble,
- inputs=[state],
- outputs=[state, bubble_list])
- scroll_btn.click(fn=None,
- js="""() => {
- const bubbleList = document.getElementById("bubble-list");
- bubbleList.scrollTo({ top:0, behavior:'smooth' });
-}""")
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antdx/bubble/demos/chatbot.py b/components/antdx/bubble/demos/chatbot.py
deleted file mode 100644
index 201763a49cdfbe9cf25f4acb7e6359880bf10722..0000000000000000000000000000000000000000
--- a/components/antdx/bubble/demos/chatbot.py
+++ /dev/null
@@ -1,165 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.antdx as antdx
-import modelscope_studio.components.base as ms
-
-
-def create_bubble_item(i: int):
- is_ai = i % 2 != 0
- content = 'Mock AI content. ' * 20 if is_ai else f'Mock User content `{i}`.'
- return {
- "role": "ai" if is_ai else "user",
- "content": content,
- "key": i - 1
- }
-
-
-def add_bubble(state_value):
- history_len = len(state_value["history"])
- state_value["history"].append(create_bubble_item(history_len + 1))
- return gr.update(value=state_value), gr.update(
- items=state_value["history"])
-
-
-def refresh(state_value, e: gr.EventData):
- clicked_key = e._data["component"]["key"]
- gr.Info(f"You clicked refresh button, item {clicked_key}")
- state_value["history"][clicked_key]["content"] = "Refreshed"
- return gr.update(value=state_value), gr.update(
- items=state_value["history"])
-
-
-def like(state_value, e: gr.EventData):
- clicked_key = e._data["component"]["key"]
- gr.Info(f"You clicked like button, item {clicked_key}")
- state_value["history"][clicked_key]["meta"] = {
- "action": "like",
- }
- return gr.update(value=state_value), gr.update(
- items=state_value["history"])
-
-
-def dislike(state_value, e: gr.EventData):
- clicked_key = e._data["component"]["key"]
- gr.Info(f"You clicked dislike button, item {clicked_key}")
- state_value["history"][clicked_key]["meta"] = {
- "action": "dislike",
- }
- return gr.update(value=state_value), gr.update(
- items=state_value["history"])
-
-
-default_history = [
- create_bubble_item(1),
- create_bubble_item(2),
- create_bubble_item(3)
-]
-
-with gr.Blocks() as demo:
-
- with ms.Application():
- state = gr.State({"history": default_history})
- with antdx.XProvider():
- with antd.Flex(gap="small", vertical=True):
- with antd.Flex(gap="small",
- elem_style=dict(alignSelf="flex-end")):
- add_bubble_btn = antd.Button("Add Bubble")
- scroll_btn = antd.Button("Scroll To First")
- with antdx.Bubble.List(items=default_history,
- elem_style=dict(maxHeight=500),
- elem_id="chatbot") as bubble_list:
- # Define Roles
- with ms.Slot("roles"):
- with antdx.Bubble.List.Role(
- role="ai",
- placement="start",
- typing=dict(step=5, interval=20),
- styles=dict(footer=dict(width="100%")),
- elem_style=dict(maxWidth=600)):
- with ms.Slot("avatar"):
- with antd.Avatar(elem_style=dict(
- backgroundColor="#fde3cf")):
- with ms.Slot("icon"):
- antd.Icon("UserOutlined")
- # use messageRender to render markdown content
- with ms.Slot(
- "messageRender",
- params_mapping="""content => content"""):
- ms.Markdown()
-
- # render footer
- with ms.Slot("footer",
- params_mapping="""(item) => {
- return { copy: { copyable: { text: item.content, tooltips: false } } ,refresh: { key: item.key }, like: { key: item.key, color: item.meta?.action === "like" ? 'primary' : 'default' }, dislike: { key: item.key, color: item.meta?.action === "dislike" ? 'primary' : 'default' } }
- }"""):
- with antd.Typography.Text(
- copyable=dict(tooltips=False),
- as_item="copy"):
- with ms.Slot("copyable.icon"):
- with antd.Button(value=None,
- size="small",
- color="default",
- variant="text"):
- with ms.Slot("icon"):
- antd.Icon("CopyOutlined")
- with antd.Button(value=None,
- size="small",
- color="default",
- variant="text"):
- with ms.Slot("icon"):
- antd.Icon("CheckOutlined")
- with antd.Button(
- value=None,
- size="small",
- color="default",
- variant="text",
- as_item="refresh") as refresh_btn:
- with ms.Slot("icon"):
- antd.Icon("SyncOutlined")
- refresh_btn.click(fn=refresh,
- inputs=[state],
- outputs=[state, bubble_list])
- with antd.Button(value=None,
- size="small",
- variant="text",
- as_item="like") as like_btn:
- with ms.Slot("icon"):
- antd.Icon("SmileOutlined")
- like_btn.click(fn=like,
- inputs=[state],
- outputs=[state, bubble_list])
- with antd.Button(
- value=None,
- size="small",
- variant="text",
- as_item="dislike") as dislike_btn:
- with ms.Slot("icon"):
- antd.Icon("FrownOutlined")
- dislike_btn.click(fn=dislike,
- inputs=[state],
- outputs=[state, bubble_list])
-
- with antdx.Bubble.List.Role(
- role="user",
- placement="end",
- ):
- with ms.Slot("avatar"):
- with antd.Avatar(elem_style=dict(
- backgroundColor="#87d068")):
- with ms.Slot("icon"):
- antd.Icon("UserOutlined")
- with ms.Slot(
- "messageRender",
- params_mapping="(content) => content"):
- ms.Markdown()
- add_bubble_btn.click(fn=add_bubble,
- inputs=[state],
- outputs=[state, bubble_list])
- scroll_btn.click(fn=None,
- js="""() => {
- const bubbleList = document.getElementById("chatbot");
- bubbleList.scrollTo({ top:0, behavior:'smooth' });
-}""")
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antdx/bubble/demos/custom_list_content.py b/components/antdx/bubble/demos/custom_list_content.py
deleted file mode 100644
index a54466e8c1df8545063ddd3cfe03f49ea198f4b0..0000000000000000000000000000000000000000
--- a/components/antdx/bubble/demos/custom_list_content.py
+++ /dev/null
@@ -1,118 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.antdx as antdx
-import modelscope_studio.components.base as ms
-
-items = [
- {
- "key": '1',
- "role": "ai-markdown",
- "content": "`Hello, world!`"
- },
- {
- "key": '2',
- "role": "ai-error-message",
- "content": "Error message"
- },
- {
- "key":
- '3',
- "role":
- 'ai-suggestion',
- "content": [
- {
- "key": '1',
- "description":
- 'How to rest effectively after long hours of work?',
- },
- {
- "key":
- '2',
- "description":
- 'What are the secrets to maintaining a positive mindset?',
- },
- {
- "key": '3',
- "description": 'How to stay calm under immense pressure?',
- },
- ],
- },
- {
- "key":
- '4',
- "role":
- 'ai-file',
- "content": [
- {
- "uid": '1',
- "name": 'excel-file.xlsx',
- "size": 111111,
- "description": 'Checking the data',
- },
- {
- "uid": '2',
- "name": 'word-file.docx',
- "size": 222222,
- "status": 'uploading',
- "percent": 23,
- },
- ],
- },
-]
-
-with gr.Blocks() as demo:
-
- with ms.Application():
- with antdx.XProvider():
- antd.Typography.Paragraph(
- "Customize the content of the bubble list, which is very useful for personalized customization scenarios."
- )
- with antdx.Bubble.List(items=items) as bubble_list:
- # Define Roles
- with ms.Slot("roles"):
- with antdx.Bubble.List.Role(role="ai-markdown",
- placement="start"):
- with ms.Slot("avatar"):
- with antd.Avatar(elem_style=dict(
- backgroundColor="#fde3cf")):
- with ms.Slot("icon"):
- antd.Icon("UserOutlined")
- with ms.Slot("messageRender",
- params_mapping="(content) => content"):
- ms.Markdown()
- with antdx.Bubble.List.Role(role="ai-error-message",
- placement="start"):
- with ms.Slot("avatar"):
- with antd.Avatar(elem_style=dict(
- backgroundColor="#fde3cf")):
- with ms.Slot("icon"):
- antd.Icon("UserOutlined")
- with ms.Slot("messageRender",
- params_mapping="(content) => content"):
- antd.Typography.Text(type="danger")
- with antdx.Bubble.List.Role(
- role="ai-suggestion",
- placement="start",
- variant="borderless",
- avatar=dict(style=dict(visibility='hidden'))):
- with ms.Slot("messageRender",
- params_mapping="(items) => ({ items })"):
- prompts = antdx.Prompts(vertical=True)
-
- with antdx.Bubble.List.Role(
- role="ai-file",
- placement="start",
- variant="borderless",
- avatar=dict(style=dict(visibility='hidden'))):
- with ms.Slot("messageRender",
- params_mapping="""(content) => {
- return {
- each: content?.map(item => ({ item }))
- }
-}"""):
- with antd.Flex(vertical=True, gap="middle"):
- with ms.Each(as_item="each"):
- antdx.Attachments.FileCard()
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antdx/bubble/demos/typing_effect.py b/components/antdx/bubble/demos/typing_effect.py
deleted file mode 100644
index 63e5ef4a34df52a1f4c871239d482d5c5f4dce2a..0000000000000000000000000000000000000000
--- a/components/antdx/bubble/demos/typing_effect.py
+++ /dev/null
@@ -1,45 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.antdx as antdx
-import modelscope_studio.components.base as ms
-
-text = "Ant Design X love you! "
-
-
-def repeat(state_value):
- if state_value["repeat"] < 5:
- state_value["repeat"] = state_value["repeat"] + 1
- else:
- state_value["repeat"] = 1
- repeat_value = state_value["repeat"]
- return gr.update(value=state_value), gr.update(
- value=f"Repeat {repeat_value} Times"), gr.update(
- content=text * repeat_value), gr.update(content=text *
- repeat_value)
-
-
-with gr.Blocks() as demo:
- state = gr.State({"repeat": 1})
- with ms.Application():
- with antdx.XProvider():
- antd.Typography.Paragraph(
- "Enable typing output by setting the typing prop. If the updated content is a subset of the previous content, it will continue to output, otherwise it will output again."
- )
- with antd.Flex(vertical=True, gap="small"):
- with antdx.Bubble(content=text,
- typing=dict(step=2, interval=50)) as bubble1:
- with ms.Slot("avatar.icon"):
- antd.Icon("UserOutlined")
- with antdx.Bubble(content=text,
- typing=dict(step=2, interval=50,
- suffix="💗")) as bubble2:
- with ms.Slot("avatar.icon"):
- antd.Icon("UserOutlined")
- btn = antd.Button("Repeat 1 Times",
- elem_style=dict(alignSelf="flex-end"))
- btn.click(fn=repeat,
- inputs=[state],
- outputs=[state, btn, bubble1, bubble2])
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antdx/bubble/demos/variant.py b/components/antdx/bubble/demos/variant.py
deleted file mode 100644
index 6b5ff50e10f8be1ddb750f9a50b006e4ad43f662..0000000000000000000000000000000000000000
--- a/components/antdx/bubble/demos/variant.py
+++ /dev/null
@@ -1,56 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.antdx as antdx
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antdx.XProvider():
- antd.Typography.Paragraph(
- "Set the style variant of the bubble through the variant property."
- )
- with antd.Flex(vertical=True, gap="middle"):
- with antdx.Bubble(variant="filled", content="variant: filled"):
- with ms.Slot("avatar.icon"):
- antd.Icon("UserOutlined")
- with antdx.Bubble(variant="outlined",
- content="variant: outlined"):
- with ms.Slot("avatar.icon"):
- antd.Icon("UserOutlined")
- with antdx.Bubble(variant="shadow", content="variant: shadow"):
- with ms.Slot("avatar.icon"):
- antd.Icon("UserOutlined")
- with antdx.Bubble(variant="borderless"):
- with ms.Slot("avatar.icon"):
- antd.Icon("UserOutlined")
- with ms.Slot("content"):
- with antdx.Prompts(
- vertical=True,
- title="variant: borderless to customize"):
- with antdx.Prompts.Item(
- key='1',
- description=
- 'How to rest effectively after long hours of work?'
- ):
- with ms.Slot("icon"):
- antd.Icon("CoffeeOutlined",
- elem_style={"color": '#964B00'})
- with antdx.Prompts.Item(
- key='2',
- description=
- 'What are the secrets to maintaining a positive mindset?',
- ):
- with ms.Slot("icon"):
- antd.Icon("SmileOutlined",
- elem_style={"color": '#FAAD14'})
- with antdx.Prompts.Item(
- key='3',
- description=
- 'How to stay calm under immense pressure?',
- ):
- with ms.Slot("icon"):
- antd.Icon("FireOutlined",
- elem_style={"color": '#FF4D4F'})
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antdx/conversations/README-zh_CN.md b/components/antdx/conversations/README-zh_CN.md
deleted file mode 100644
index 817b9398be0c653df50ae99ca16dcb1fdc95f10f..0000000000000000000000000000000000000000
--- a/components/antdx/conversations/README-zh_CN.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# Conversations
-
-Used to manage and view the conversation list. See [Ant Design X](https://x.ant.design/components/conversations/) for more information.
-
-## Examples
-
-
-
-
diff --git a/components/antdx/conversations/README.md b/components/antdx/conversations/README.md
deleted file mode 100644
index 817b9398be0c653df50ae99ca16dcb1fdc95f10f..0000000000000000000000000000000000000000
--- a/components/antdx/conversations/README.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# Conversations
-
-Used to manage and view the conversation list. See [Ant Design X](https://x.ant.design/components/conversations/) for more information.
-
-## Examples
-
-
-
-
diff --git a/components/antdx/conversations/app.py b/components/antdx/conversations/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antdx/conversations/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antdx/conversations/demos/basic.py b/components/antdx/conversations/demos/basic.py
deleted file mode 100644
index 9aefba8a1a67340b08989abb77a35f40fc571fcc..0000000000000000000000000000000000000000
--- a/components/antdx/conversations/demos/basic.py
+++ /dev/null
@@ -1,49 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.antdx as antdx
-import modelscope_studio.components.base as ms
-
-
-def active_change(e: gr.EventData):
- print(e._data["payload"])
-
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antdx.XProvider():
- conversations1 = antdx.Conversations(default_active_key="item1",
- items=[{
- "key": "item1",
- "label": "Item1"
- }, {
- "key": "item2",
- "label": "Item2",
- }, {
- "key": "item3",
- "label": "Item3",
- }, {
- "key": "item4",
- "label": "Item4",
- "disabled": True
- }])
-
- antd.Divider("Customized Item")
-
- with antdx.Conversations(
- default_active_key="item1") as conversations2:
- with antdx.Conversations.Item(key="item1"):
- with ms.Slot("label"):
- antd.Typography.Text("Item1", type="success")
- with ms.Slot("icon"):
- antd.Icon()
-
- with antdx.Conversations.Item(key="item2"):
- with ms.Slot("label"):
- antd.Typography.Text("Item2", type="success")
- with ms.Slot("icon"):
- antd.Icon()
- conversations1.active_change(fn=active_change)
- conversations2.active_change(fn=active_change)
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antdx/conversations/demos/group.py b/components/antdx/conversations/demos/group.py
deleted file mode 100644
index 039dd1c7a878903665c2afb9fea75cb8939cd676..0000000000000000000000000000000000000000
--- a/components/antdx/conversations/demos/group.py
+++ /dev/null
@@ -1,30 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antdx as antdx
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antdx.XProvider():
- conversations1 = antdx.Conversations(default_active_key="item1",
- groupable=True,
- items=[{
- "key": "item1",
- "label": "Item1",
- "group": "Group1"
- }, {
- "key": "item2",
- "label": "Item2",
- "group": "Group1"
- }, {
- "key": "item3",
- "label": "Item3",
- "group": "Group2"
- }, {
- "key": "item4",
- "label": "Item4",
- "group": "Group2",
- "disabled": True
- }])
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antdx/conversations/demos/operations.py b/components/antdx/conversations/demos/operations.py
deleted file mode 100644
index f8dea474176016a7b0a3b81705a588309ff0d757..0000000000000000000000000000000000000000
--- a/components/antdx/conversations/demos/operations.py
+++ /dev/null
@@ -1,46 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.antdx as antdx
-import modelscope_studio.components.base as ms
-
-
-def menu_click(e: gr.EventData):
- print(e._data["payload"])
-
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antdx.XProvider():
- with antdx.Conversations(default_active_key="item1",
- items=[{
- "key": "item1",
- "label": "Item1"
- }, {
- "key": "item2",
- "label": "Item2",
- }, {
- "key": "item3",
- "label": "Item3",
- }, {
- "key": "item4",
- "label": "Item4",
- "disabled": True
- }]) as conversations:
- with ms.Slot("menu.items"):
- with antd.Menu.Item(label="Operation 1", key="o1"):
- with ms.Slot("icon"):
- antd.Icon("EditOutlined")
- with antd.Menu.Item(label="Operation 2",
- key="o2",
- disabled=True):
- with ms.Slot("icon"):
- antd.Icon("StopOutlined")
- with antd.Menu.Item(label="Operation 3",
- key="o3",
- danger=True):
- with ms.Slot("icon"):
- antd.Icon("DeleteOutlined")
- conversations.menu_click(fn=menu_click)
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antdx/overview/README-zh_CN.md b/components/antdx/overview/README-zh_CN.md
deleted file mode 100644
index 0c741a37666950c3c2ea2c1f909d41876322bfca..0000000000000000000000000000000000000000
--- a/components/antdx/overview/README-zh_CN.md
+++ /dev/null
@@ -1,20 +0,0 @@
-# 概览
-
-`modelscope_studio`集成了 [Ant Design X](https://x.ant.design/) 的组件,并支持大部分的组件属性,您只需要引入`antdx`模块即可直接使用。
-
-```python
-import modelscope_studio.components.antdx as antdx
-```
-
-## 快速开始
-
-
-
-注意:其中`ms.Application`与`antdx.XProvider`(或者`antd.ConfigProvider`)是必须的。
-
-- `Application` 包含了`modelscope_studio`中所有的组件依赖,请确保`modelscope_studio`所有导出的组件都被其包裹,否则页面将会无法成功预览。
-- `XProvider`(`ConfigProvider`) 与 Ant Design X(Ant Design)中的功能一致,除此之外,我们还加了一些额外的适配来兼容 Gradio 的样式。因此,为了保证页面样式正常,所有的`antdx`组件需要包裹在该组件下。
-
-## 其他
-
-同`Antd`组件。
diff --git a/components/antdx/overview/README.md b/components/antdx/overview/README.md
deleted file mode 100644
index 9cde788329e8855c9bc6e482bffdbb2799e069ec..0000000000000000000000000000000000000000
--- a/components/antdx/overview/README.md
+++ /dev/null
@@ -1,20 +0,0 @@
-# Overview
-
-`modelscope_studio` integrates [Ant Design X](https://x.ant.design/) components and supports most component properties. You can use them directly by importing the `antdx` module.
-
-```python
-import modelscope_studio.components.antdx as antdx
-```
-
-## Quick Start
-
-
-
-Note: Both `ms.Application` and `antdx.XProvider`(or `antd.ConfigProvider`) are required.
-
-- `Application` contains all component dependencies in `modelscope_studio`. Please ensure that all components exported from `modelscope_studio` are wrapped by it, otherwise the page will not be successfully previewed.
-- `XProvider`(`ConfigProvider`) functions the same as in Ant Design X(Ant Design). Additionally, we have added some extra adaptations to be compatible with Gradio's styles. Therefore, to ensure normal page styling, all `antdx` components need to be wrapped within this component.
-
-## Others
-
-Same as `Antd` components.
diff --git a/components/antdx/overview/app.py b/components/antdx/overview/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antdx/overview/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antdx/overview/demos/quick_start.py b/components/antdx/overview/demos/quick_start.py
deleted file mode 100644
index 14cf08324be74b9f1425f454b82c1fc3b8efae0a..0000000000000000000000000000000000000000
--- a/components/antdx/overview/demos/quick_start.py
+++ /dev/null
@@ -1,17 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antdx as antdx
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antdx.XProvider(): # or antd.ConfigProvider
- antdx.Welcome(
- icon=
- "https://mdn.alipayobjects.com/huamei_iwk9zp/afts/img/A*s5sNRo5LjfQAAAAAAAAAAAAADgCCAQ/fmt.webp",
- title="Hello, I'm Ant Design X",
- description=
- "Base on Ant Design, AGI product interface solution, create a better intelligent vision~"
- )
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antdx/prompts/README-zh_CN.md b/components/antdx/prompts/README-zh_CN.md
deleted file mode 100644
index 3997206da0af74b94a7d73c906440999c4322755..0000000000000000000000000000000000000000
--- a/components/antdx/prompts/README-zh_CN.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# Prompts
-
-Display a predefined set of questions or suggestion. See [Ant Design X](https://x.ant.design/components/prompts/) for more information.
-
-## Examples
-
-
-
diff --git a/components/antdx/prompts/README.md b/components/antdx/prompts/README.md
deleted file mode 100644
index 3997206da0af74b94a7d73c906440999c4322755..0000000000000000000000000000000000000000
--- a/components/antdx/prompts/README.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# Prompts
-
-Display a predefined set of questions or suggestion. See [Ant Design X](https://x.ant.design/components/prompts/) for more information.
-
-## Examples
-
-
-
diff --git a/components/antdx/prompts/app.py b/components/antdx/prompts/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antdx/prompts/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antdx/prompts/demos/basic.py b/components/antdx/prompts/demos/basic.py
deleted file mode 100644
index 0746f7a11903d33bcaade9eb87b67e103cd67aea..0000000000000000000000000000000000000000
--- a/components/antdx/prompts/demos/basic.py
+++ /dev/null
@@ -1,81 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.antdx as antdx
-import modelscope_studio.components.base as ms
-
-
-def item_click(e: gr.EventData):
- payload = e._data["payload"]
- gr.Info("You clicked on item " + payload[0]["data"]["key"])
-
-
-default_vertical = False
-default_wrap = False
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antdx.XProvider():
- vertical = antd.Switch(value=default_vertical,
- checked_children="Vertical",
- un_checked_children="Horizontal")
- wrap = antd.Switch(value=default_wrap,
- checked_children="Wrap",
- un_checked_children="No Wrap")
- with antdx.Prompts(
- title="✨ Inspirational Sparks and Marvelous Tips",
- wrap=default_wrap,
- vertical=default_vertical) as prompts:
- with antdx.Prompts.Item(
- key='1',
- label='Ignite Your Creativity',
- description='Got any sparks for a new project?',
- disabled=True):
- with ms.Slot("icon"):
- antd.Icon("BulbOutlined",
- elem_style={"color": '#FFD700'})
- with antdx.Prompts.Item(
- key='2',
- label='Uncover Background Info',
- description=
- 'Help me understand the background of this topic.',
- ):
- with ms.Slot("icon"):
- antd.Icon("InfoCircleOutlined",
- elem_style={"color": '#1890FF'})
- with antdx.Prompts.Item(
- key='3',
- label='Efficiency Boost Battle',
- description='How can I work faster and better?',
- ):
- with ms.Slot("icon"):
- antd.Icon("RocketOutlined",
- elem_style={"color": '#722ED1'})
- with antdx.Prompts.Item(
- key='4',
- label='Tell me a Joke',
- description=
- 'Why do not ants get sick? Because they have tiny ant-bodies!',
- ):
- with ms.Slot("icon"):
- antd.Icon("SmileOutlined",
- elem_style={"color": '#52C41A'})
- with antdx.Prompts.Item(
- key='5',
- label='Common Issue Solutions',
- description=
- 'How to solve common issues? Share some tips!',
- ):
- with ms.Slot("icon"):
- antd.Icon("WarningOutlined",
- elem_style={"color": '#FF4D4F'})
-
- prompts.item_click(fn=item_click)
- vertical.change(fn=lambda x: gr.update(vertical=x),
- inputs=[vertical],
- outputs=[prompts])
- wrap.change(fn=lambda x: gr.update(wrap=x),
- inputs=[wrap],
- outputs=[prompts])
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antdx/prompts/demos/nest_usage.py b/components/antdx/prompts/demos/nest_usage.py
deleted file mode 100644
index 54ebb75498c4ccb79de3d75bd67556e761ed2dcf..0000000000000000000000000000000000000000
--- a/components/antdx/prompts/demos/nest_usage.py
+++ /dev/null
@@ -1,86 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.antdx as antdx
-import modelscope_studio.components.base as ms
-
-
-def item_click(e: gr.EventData):
- payload = e._data["payload"]
- gr.Info("You clicked on item " + payload[0]["data"]["key"])
-
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antdx.XProvider(theme=dict(algorithm=dict(dark=False))):
- with antd.Card(elem_style=dict(borderRadius=0, border=0)):
- with antdx.Prompts(
- title="Do you want?",
- wrap=True,
- styles=dict(item={
- "flex": 'none',
- "width": 'calc(30% - 6px)',
- "backgroundImage":
- "linear-gradient(137deg, #e5f4ff 0%, #efe7ff 100%)",
- "border": 0,
- },
- subItem={
- "background": 'rgba(255,255,255,0.45)',
- "border": '1px solid #FFF',
- })) as prompts:
- with antdx.Prompts.Item(
- key='1',
- description='What are you interested in?',
- ):
- with ms.Slot("label"):
- with antd.Space():
- antd.Icon("FireOutlined",
- elem_style={"color": '#FF4D4F'})
- ms.Text("Hot Topics")
- antdx.Prompts.Item(key="1-1",
- description="What's new in X?")
- antdx.Prompts.Item(key="1-2",
- description="What's AGI?")
- antdx.Prompts.Item(key="1-3",
- description="Where is the doc?")
- with antdx.Prompts.Item(
- key='2',
- description='How to design a good product?',
- ):
- with ms.Slot("label"):
- with antd.Space():
- antd.Icon("ReadOutlined",
- elem_style={"color": '#1890FF'})
- ms.Text("Design Guide")
- with antdx.Prompts.Item(key="2-1",
- description="Know the well"):
- with ms.Slot("icon"):
- antd.Icon("HeartOutlined")
- with antdx.Prompts.Item(key="2-2",
- description="Set the AI role"):
- with ms.Slot("icon"):
- antd.Icon("SmileOutlined")
- with antdx.Prompts.Item(
- key="2-3", description="Express the feeling"):
- with ms.Slot("icon"):
- antd.Icon("CommentOutlined")
- with antdx.Prompts.Item(
- key='3',
- description='How to start a new project?',
- ):
- with ms.Slot("label"):
- with antd.Space():
- antd.Icon("RocketOutlined",
- elem_style={"color": '#722ED1'})
- ms.Text("Start Creating")
- antdx.Prompts.Item(key="3-1",
- label='Fast Start',
- description="Install Ant Design X")
- antdx.Prompts.Item(
- key="3-2",
- label='Online Playground',
- description="Play on the web without installing")
-
- prompts.item_click(fn=item_click)
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antdx/sender/README-zh_CN.md b/components/antdx/sender/README-zh_CN.md
deleted file mode 100644
index 5ce20253aae55cacacd48efb1301743c90d16976..0000000000000000000000000000000000000000
--- a/components/antdx/sender/README-zh_CN.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# Sender
-
-A input component for chat. See [Ant Design X](https://x.ant.design/components/sender/) for more information.
-
-## Examples
-
-
-
-
diff --git a/components/antdx/sender/README.md b/components/antdx/sender/README.md
deleted file mode 100644
index 5ce20253aae55cacacd48efb1301743c90d16976..0000000000000000000000000000000000000000
--- a/components/antdx/sender/README.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# Sender
-
-A input component for chat. See [Ant Design X](https://x.ant.design/components/sender/) for more information.
-
-## Examples
-
-
-
-
diff --git a/components/antdx/sender/app.py b/components/antdx/sender/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antdx/sender/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antdx/sender/demos/basic.py b/components/antdx/sender/demos/basic.py
deleted file mode 100644
index f695c9905654e870fa711bf8b1a99cb14c47559e..0000000000000000000000000000000000000000
--- a/components/antdx/sender/demos/basic.py
+++ /dev/null
@@ -1,27 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.antdx as antdx
-import modelscope_studio.components.base as ms
-
-
-def submit():
- return gr.update(loading=True, read_only=True)
-
-
-def cancel():
- return gr.update(loading=False, read_only=False)
-
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antdx.XProvider():
- with antd.Flex(vertical=True, gap="middle"):
- sender = antdx.Sender()
- antdx.Sender("Force as loading", loading=True, read_only=True)
- antdx.Sender("Set to disabled", disabled=True)
-
- sender.submit(fn=submit, outputs=[sender])
- sender.cancel(fn=cancel, outputs=[sender])
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antdx/sender/demos/header_panel.py b/components/antdx/sender/demos/header_panel.py
deleted file mode 100644
index a4912b345030ede6ee8ccb4ac1b06bfce8dff870..0000000000000000000000000000000000000000
--- a/components/antdx/sender/demos/header_panel.py
+++ /dev/null
@@ -1,77 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.antdx as antdx
-import modelscope_studio.components.base as ms
-
-
-def paste_file(attachments_value, e: gr.EventData):
- return gr.update(value=attachments_value + e._data["payload"][0])
-
-
-def toggle_open(state_value):
- state_value["open"] = not state_value["open"]
- return gr.update(open=state_value["open"]), gr.update(value=state_value)
-
-
-def submit(sender_value, attachments_value):
- print(sender_value, attachments_value)
- return gr.update(value=None), gr.update(value=None)
-
-
-with gr.Blocks() as demo:
- state = gr.State({"open": False})
- with ms.Application():
- with antdx.XProvider():
- antd.Typography.Paragraph(
- "Use header to customize the file upload example and paste image to upload files with Attachments."
- )
- with antdx.Sender(placeholder="← Click to open") as sender:
- with ms.Slot("prefix"):
- with antd.Button(value=None, type="text") as prefix_button:
- with ms.Slot("icon"):
- antd.Icon("LinkOutlined")
- with ms.Slot("header"):
- with antdx.Sender.Header(title="Attachments",
- open=False,
- styles={
- "content": {
- "padding": 0,
- },
- }) as sender_header:
- with antdx.Attachments() as attachments:
- with ms.Slot(
- "placeholder.title",
- params_mapping=
- """(type) => type === 'drop' ? 'Drop file here' : 'Upload files'"""
- ):
- ms.Span()
- with ms.Slot(
- "placeholder.description",
- params_mapping=
- "(type) => ({ style: { display: type === 'drop'? 'none' : undefined } })"
- ):
- ms.Span(
- "Click or drag files to this area to upload"
- )
- with ms.Slot(
- "placeholder.icon",
- params_mapping=
- "(type) => ({ style: { display: type === 'drop'? 'none' : undefined } })"
- ):
- antd.Icon("CloudUploadOutlined")
-
- sender_header.open_change(fn=toggle_open,
- inputs=[state],
- outputs=[sender_header, state])
- prefix_button.click(fn=toggle_open,
- inputs=[state],
- outputs=[sender_header, state])
- sender.submit(fn=submit,
- inputs=[sender, attachments],
- outputs=[sender, attachments])
- sender.paste_file(fn=paste_file,
- inputs=[attachments],
- outputs=[attachments])
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antdx/sender/demos/submit_type.py b/components/antdx/sender/demos/submit_type.py
deleted file mode 100644
index 5b61f4cb8ba006dd91c3225d5053007bce27bed4..0000000000000000000000000000000000000000
--- a/components/antdx/sender/demos/submit_type.py
+++ /dev/null
@@ -1,27 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.antdx as antdx
-import modelscope_studio.components.base as ms
-
-
-def submit():
- return gr.update(loading=True, read_only=True)
-
-
-def cancel():
- return gr.update(loading=False, read_only=False)
-
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antdx.XProvider():
- with antd.Flex(vertical=True, gap="middle"):
- sender = antdx.Sender(
- submit_type="shiftEnter",
- placeholder="Press Shift + Enter to send message")
-
- sender.submit(fn=submit, outputs=[sender])
- sender.cancel(fn=cancel, outputs=[sender])
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antdx/suggestion/README-zh_CN.md b/components/antdx/suggestion/README-zh_CN.md
deleted file mode 100644
index ea01f28901da8ea3802acdd8c69b95ccf6fa13f9..0000000000000000000000000000000000000000
--- a/components/antdx/suggestion/README-zh_CN.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# Suggestion
-
-A suggestion component for chat. See [Ant Design X](https://x.ant.design/components/suggestion/) for more information.
-
-## Examples
-
-
-
-
diff --git a/components/antdx/suggestion/README.md b/components/antdx/suggestion/README.md
deleted file mode 100644
index ea01f28901da8ea3802acdd8c69b95ccf6fa13f9..0000000000000000000000000000000000000000
--- a/components/antdx/suggestion/README.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# Suggestion
-
-A suggestion component for chat. See [Ant Design X](https://x.ant.design/components/suggestion/) for more information.
-
-## Examples
-
-
-
-
diff --git a/components/antdx/suggestion/app.py b/components/antdx/suggestion/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antdx/suggestion/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antdx/suggestion/demos/basic.py b/components/antdx/suggestion/demos/basic.py
deleted file mode 100644
index 9852c3bf079ec489893b10d2ffa11d25cd319056..0000000000000000000000000000000000000000
--- a/components/antdx/suggestion/demos/basic.py
+++ /dev/null
@@ -1,43 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.antdx as antdx
-import modelscope_studio.components.base as ms
-
-
-def select_suggestion(e: gr.EventData):
- return gr.update(value=e._data["payload"][0])
-
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antdx.XProvider():
- with antdx.Suggestion(
- # onKeyDown Handler in Javascript
- should_trigger="""(e, { onTrigger, onKeyDown }) => {
- const value = e.target.value
- if (value === '/') {
- onTrigger()
- } else if (!value) {
- onTrigger(false);
- }
- onKeyDown(e)
- }""") as suggestion:
- with ms.Slot("items"):
- antdx.Suggestion.Item(label="Write a report",
- value="report")
- antdx.Suggestion.Item(label="Draw a picture", value="draw")
- with antdx.Suggestion.Item(label="Check some knowledge",
- value="knowledge"):
- with ms.Slot("icon"):
- antd.Icon("OpenAIFilled")
- antdx.Suggestion.Item(label="About React",
- value="react")
- antdx.Suggestion.Item(label="About Ant Design",
- value="antd")
- with ms.Slot("children"):
- sender = antdx.Sender(
- placeholder="Enter / to get suggestions")
- suggestion.select(fn=select_suggestion, outputs=[sender])
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antdx/suggestion/demos/block.py b/components/antdx/suggestion/demos/block.py
deleted file mode 100644
index d41c02fdbb8d65f46ad63032c246e6dc22ca9d20..0000000000000000000000000000000000000000
--- a/components/antdx/suggestion/demos/block.py
+++ /dev/null
@@ -1,58 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.antdx as antdx
-import modelscope_studio.components.base as ms
-
-items = [
- {
- "label": 'Write a report',
- "value": 'report'
- },
- {
- "label": 'Draw a picture',
- "value": 'draw'
- },
- {
- "label": 'Check some knowledge',
- "value": 'knowledge',
- "extra": 'Extra Info',
- },
-]
-
-
-def select_suggestion(e: gr.EventData):
- return gr.update(value=e._data["payload"][0])
-
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antdx.XProvider():
- antd.Typography.Paragraph(
- "Set `block` to display in a whole row. ``extra` can be used to configure additional information."
- )
- with antdx.Suggestion(
- items=items,
- block=True,
- # onKeyDown Handler in Javascript
- should_trigger="""(e, { onTrigger, onKeyDown }) => {
- switch(e.key) {
- case '/':
- onTrigger()
- break
- case 'ArrowRight':
- case 'ArrowLeft':
- case 'ArrowUp':
- case 'ArrowDown':
- break;
- default:
- onTrigger(false)
- }
- onKeyDown(e)
- }""") as suggestion:
- with ms.Slot("children"):
- sender = antdx.Sender(
- placeholder="Enter / to get suggestions")
- suggestion.select(fn=select_suggestion, outputs=[sender])
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antdx/suggestion/demos/controlled_by_python.py b/components/antdx/suggestion/demos/controlled_by_python.py
deleted file mode 100644
index c6b93be335644dbd9300059a60e6580200ef6629..0000000000000000000000000000000000000000
--- a/components/antdx/suggestion/demos/controlled_by_python.py
+++ /dev/null
@@ -1,54 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antdx as antdx
-import modelscope_studio.components.base as ms
-
-items = [
- {
- "label": 'Write a report',
- "value": 'report'
- },
- {
- "label": 'Draw a picture',
- "value": 'draw'
- },
- {
- "label": 'Check some knowledge',
- "value": 'knowledge',
- "extra": 'Extra Info',
- },
-]
-
-
-def select_suggestion(e: gr.EventData):
- return gr.update(value=e._data["payload"][0]), gr.update(open=False)
-
-
-def change_sender(sender_value: str):
- splitted_value = sender_value.split("/")
- command = sender_value.split("/")[-1]
- if len(splitted_value) > 1:
- filtered_items = [
- item for item in items
- if item["label"].upper().find(command.upper()) != -1
- and not command.startswith(item["value"])
- ]
- if len(filtered_items) > 0:
- return gr.update(open=True, items=filtered_items)
- return gr.update(open=False)
-
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antdx.XProvider():
- with antdx.Suggestion(open=False) as suggestion:
- with ms.Slot("children"):
- sender = antdx.Sender(
- placeholder="Enter / to get suggestions")
- sender.change(fn=change_sender,
- inputs=[sender],
- outputs=[suggestion])
- suggestion.select(fn=select_suggestion,
- outputs=[sender, suggestion])
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antdx/thought_chain/README-zh_CN.md b/components/antdx/thought_chain/README-zh_CN.md
deleted file mode 100644
index 9b9163764ba70264a6fef3e12a3d6a88a934aac7..0000000000000000000000000000000000000000
--- a/components/antdx/thought_chain/README-zh_CN.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# ThoughtChain
-
-The ThoughtChain component is used to visualize and track the call chain of Actions and Tools invoked by an Agent. See [Ant Design X](https://x.ant.design/components/thought-chain/) for more information.
-
-## Examples
-
-
-
-
diff --git a/components/antdx/thought_chain/README.md b/components/antdx/thought_chain/README.md
deleted file mode 100644
index 9b9163764ba70264a6fef3e12a3d6a88a934aac7..0000000000000000000000000000000000000000
--- a/components/antdx/thought_chain/README.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# ThoughtChain
-
-The ThoughtChain component is used to visualize and track the call chain of Actions and Tools invoked by an Agent. See [Ant Design X](https://x.ant.design/components/thought-chain/) for more information.
-
-## Examples
-
-
-
-
diff --git a/components/antdx/thought_chain/app.py b/components/antdx/thought_chain/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antdx/thought_chain/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antdx/thought_chain/demos/basic.py b/components/antdx/thought_chain/demos/basic.py
deleted file mode 100644
index 762983df2f1ef0002d320087f11e8eb0362d74fb..0000000000000000000000000000000000000000
--- a/components/antdx/thought_chain/demos/basic.py
+++ /dev/null
@@ -1,76 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.antdx as antdx
-import modelscope_studio.components.base as ms
-
-default_collapsible = False
-
-
-def mock_content():
- with antd.Typography.Paragraph():
- antd.Typography.Paragraph(
- "In the process of internal desktop applications development, many different design specs and implementations would be involved, which might cause designers and developers difficulties and duplication and reduce the efficiency of development."
- )
- with antd.Typography.Paragraph():
- ms.Text(
- "After massive project practice and summaries, Ant Design, a design language for background applications, is refined by Ant UED Team, which aims to "
- )
- antd.Typography.Text(
- "uniform the user interface specs for internal background projects, lower the unnecessary cost of design differences and implementation and liberate the resources of design and front-end development",
- strong=True,
- )
-
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antdx.XProvider():
- collapsible = antd.Switch(default_collapsible,
- checked_children="Collapsible",
- un_checked_children="Not Collapsible")
- with antd.Card():
- with antdx.ThoughtChain(
- collapsible=default_collapsible) as thought_chain:
- with antdx.ThoughtChain.Item(
- title="Thought Chain Item Title 1",
- description="description",
- status="success"):
- with ms.Slot("extra"):
- with antd.Button(value=None, type="text"):
- with ms.Slot("icon"):
- antd.Icon("MoreOutlined")
- with ms.Slot("content"):
- mock_content()
- with ms.Slot("footer"):
- antd.Button("Thought Chain Item Footer",
- block=True)
- with antdx.ThoughtChain.Item(
- title="Thought Chain Item Title 2",
- description="description",
- status="error"):
- with ms.Slot("extra"):
- with antd.Button(value=None, type="text"):
- with ms.Slot("icon"):
- antd.Icon("MoreOutlined")
- with ms.Slot("content"):
- mock_content()
- with ms.Slot("footer"):
- antd.Button("Thought Chain Item Footer",
- block=True)
- with antdx.ThoughtChain.Item(
- title="Thought Chain Item Title 3",
- description="description",
- status="pending"):
- with ms.Slot("extra"):
- with antd.Button(value=None, type="text"):
- with ms.Slot("icon"):
- antd.Icon("MoreOutlined")
- with ms.Slot("content"):
- mock_content()
- with ms.Slot("footer"):
- antd.Button("Thought Chain Item Footer",
- block=True)
- collapsible.change(fn=lambda x: gr.update(collapsible=x),
- inputs=[collapsible],
- outputs=[thought_chain])
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antdx/thought_chain/demos/item_status.py b/components/antdx/thought_chain/demos/item_status.py
deleted file mode 100644
index 8e7284f1c11f27e3b004055799e72f7ab0e5c61e..0000000000000000000000000000000000000000
--- a/components/antdx/thought_chain/demos/item_status.py
+++ /dev/null
@@ -1,70 +0,0 @@
-import time
-
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.antdx as antdx
-import modelscope_studio.components.base as ms
-
-
-def run_next(each_value):
- each_value.append({
- "title": f'Thought Chain Item - {len(each_value) + 1}',
- "status": 'pending',
- "description": 'status: pending',
- "icon": "LoadingOutlined",
- "key": str(len(each_value) + 1)
- })
- yield gr.update(value="Running", loading=True), gr.update(value=each_value)
- time.sleep(0.8)
- each_value[-1]["status"] = "error"
- each_value[-1]["description"] = 'status: error'
- each_value[-1]["icon"] = "InfoCircleOutlined"
- yield gr.skip(), gr.update(value=each_value)
- time.sleep(0.8)
- each_value[-1]["status"] = "pending"
- each_value[-1]["description"] = 'status: pending'
- each_value[-1]["icon"] = 'LoadingOutlined'
- yield gr.skip(), gr.update(value=each_value)
- time.sleep(0.8)
- each_value[-1]["status"] = "success"
- each_value[-1]["description"] = 'status: success'
- each_value[-1]["icon"] = "CheckCircleOutlined"
- yield gr.update(value="Run Next",
- loading=False), gr.update(value=each_value)
-
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antdx.XProvider():
- antd.Typography.Paragraph(
- "The thought chain nodes support configuring the `status` property to clearly indicate the current execution status of the node."
- )
- with antd.Card():
- with antd.Flex(vertical=True, gap="middle"):
- with ms.Div():
- btn = antd.Button("Run Next")
- with antdx.ThoughtChain():
- with ms.Each(value=[
- {
- "title": 'Thought Chain Item - 1',
- "status": 'success',
- "description": 'status: success',
- "icon": 'CheckCircleOutlined',
- "key": "1"
- },
- {
- "title": 'Thought Chain Item - 2',
- "status": 'error',
- "description": 'status: error',
- "icon": 'InfoCircleOutlined',
- "key": "2"
- },
- ]) as each:
- with antdx.ThoughtChain.Item():
- with ms.Slot("icon"):
- antd.Icon(as_item="icon")
-
- btn.click(fn=run_next, inputs=[each], outputs=[btn, each])
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antdx/thought_chain/demos/nested_use.py b/components/antdx/thought_chain/demos/nested_use.py
deleted file mode 100644
index 9ba985835dc14d02b4d06cb1fff8f47719099f81..0000000000000000000000000000000000000000
--- a/components/antdx/thought_chain/demos/nested_use.py
+++ /dev/null
@@ -1,67 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.antdx as antdx
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antdx.XProvider():
- with antd.Card():
- with antdx.ThoughtChain(collapsible=True):
- with antdx.ThoughtChain.Item(
- title="1 - Thought Chain Item",
- description="description"):
- with ms.Slot("extra"):
- with antd.Button(value=None, type="text"):
- with ms.Slot("icon"):
- antd.Icon("MoreOutlined")
- with ms.Slot("content"):
- with antdx.ThoughtChain():
- with antdx.ThoughtChain.Item(
- title="1-1 - Thought Chain Item",
- description="description"):
- with ms.Slot("extra"):
- with antd.Button(value=None,
- type="text"):
- with ms.Slot("icon"):
- antd.Icon("MoreOutlined")
- with antdx.ThoughtChain.Item(
- title="1-2 - Thought Chain Item",
- description="description"):
- with ms.Slot("extra"):
- with antd.Button(value=None,
- type="text"):
- with ms.Slot("icon"):
- antd.Icon("MoreOutlined")
- with ms.Slot("footer"):
- antd.Button("1 - Thought Chain Item Footer")
- with antdx.ThoughtChain.Item(
- title="2 - Thought Chain Item",
- description="description"):
- with ms.Slot("extra"):
- with antd.Button(value=None, type="text"):
- with ms.Slot("icon"):
- antd.Icon("MoreOutlined")
- with ms.Slot("content"):
- with antdx.ThoughtChain():
- with antdx.ThoughtChain.Item(
- title="2-1 - Thought Chain Item",
- description="description"):
- with ms.Slot("extra"):
- with antd.Button(value=None,
- type="text"):
- with ms.Slot("icon"):
- antd.Icon("MoreOutlined")
- with antdx.ThoughtChain.Item(
- title="2-2 - Thought Chain Item",
- description="description"):
- with ms.Slot("extra"):
- with antd.Button(value=None,
- type="text"):
- with ms.Slot("icon"):
- antd.Icon("MoreOutlined")
- with ms.Slot("footer"):
- antd.Button("2 - Thought Chain Item Footer")
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antdx/welcome/README-zh_CN.md b/components/antdx/welcome/README-zh_CN.md
deleted file mode 100644
index c5ad2e294d0417bc51a081cf47a8cee97fa21615..0000000000000000000000000000000000000000
--- a/components/antdx/welcome/README-zh_CN.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Welcome
-
-Clearly convey the scope of intent and expected functionality to the user. See [Ant Design X](https://x.ant.design/components/welcome/) for more information.
-
-## Examples
-
-
diff --git a/components/antdx/welcome/README.md b/components/antdx/welcome/README.md
deleted file mode 100644
index c5ad2e294d0417bc51a081cf47a8cee97fa21615..0000000000000000000000000000000000000000
--- a/components/antdx/welcome/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Welcome
-
-Clearly convey the scope of intent and expected functionality to the user. See [Ant Design X](https://x.ant.design/components/welcome/) for more information.
-
-## Examples
-
-
diff --git a/components/antdx/welcome/app.py b/components/antdx/welcome/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antdx/welcome/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/antdx/welcome/demos/basic.py b/components/antdx/welcome/demos/basic.py
deleted file mode 100644
index 87cbaad45b7f0b6dd1040c6223f2db694df45d9b..0000000000000000000000000000000000000000
--- a/components/antdx/welcome/demos/basic.py
+++ /dev/null
@@ -1,36 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.antdx as antdx
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antdx.XProvider():
- antdx.Welcome(
- icon=
- "https://mdn.alipayobjects.com/huamei_iwk9zp/afts/img/A*s5sNRo5LjfQAAAAAAAAAAAAADgCCAQ/fmt.webp",
- title="Hello, I'm Ant Design X",
- description=
- "Base on Ant Design, AGI product interface solution, create a better intelligent vision~"
- )
-
- antd.Divider("Borderless")
-
- with antdx.Welcome(
- icon=
- "https://mdn.alipayobjects.com/huamei_iwk9zp/afts/img/A*s5sNRo5LjfQAAAAAAAAAAAAADgCCAQ/fmt.webp",
- title="Hello, I'm Ant Design X",
- description=
- "Base on Ant Design, AGI product interface solution, create a better intelligent vision~",
- variant="borderless"):
- with ms.Slot("extra"):
- with antd.Space():
- with antd.Button(None):
- with ms.Slot("icon"):
- antd.Icon("ShareAltOutlined")
- with antd.Button(None):
- with ms.Slot("icon"):
- antd.Icon("EllipsisOutlined")
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/antdx/x_provider/README-zh_CN.md b/components/antdx/x_provider/README-zh_CN.md
deleted file mode 100644
index e6117ef326187743af499d1f170a4d3d2a0cd1a6..0000000000000000000000000000000000000000
--- a/components/antdx/x_provider/README-zh_CN.md
+++ /dev/null
@@ -1,18 +0,0 @@
-# XProvider
-
-Provide a uniform configuration support for x components.. See [Ant Design X](https://x.ant.design/components/x-provider/) for more information.
-
-The `XProvider` extends the `ConfigProvider` from antd and provides global configuration for components in `@ant-design/x`.
-
-If you are already using `ConfigProvider` from antd, please make the following changes to your code:
-
-```python
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.antdx as antdx
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
-- with antd.ConfigProvider():
-+ with antdx.XProvider():
-```
diff --git a/components/antdx/x_provider/README.md b/components/antdx/x_provider/README.md
deleted file mode 100644
index e6117ef326187743af499d1f170a4d3d2a0cd1a6..0000000000000000000000000000000000000000
--- a/components/antdx/x_provider/README.md
+++ /dev/null
@@ -1,18 +0,0 @@
-# XProvider
-
-Provide a uniform configuration support for x components.. See [Ant Design X](https://x.ant.design/components/x-provider/) for more information.
-
-The `XProvider` extends the `ConfigProvider` from antd and provides global configuration for components in `@ant-design/x`.
-
-If you are already using `ConfigProvider` from antd, please make the following changes to your code:
-
-```python
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.antdx as antdx
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
-- with antd.ConfigProvider():
-+ with antdx.XProvider():
-```
diff --git a/components/antdx/x_provider/app.py b/components/antdx/x_provider/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/antdx/x_provider/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/base/application/README-zh_CN.md b/components/base/application/README-zh_CN.md
deleted file mode 100644
index d73dbb8c813351c8c1ca84374b2be01b8db3c933..0000000000000000000000000000000000000000
--- a/components/base/application/README-zh_CN.md
+++ /dev/null
@@ -1,20 +0,0 @@
-# Application
-
-应用的根组件,该组件包含了所有`modelscope_studio`的组件依赖,需要确保所有从`modelscope_studio`导出的组件都被其包裹,否则页面将会无法成功预览。
-
-该组件还可以监听用户页面的生命周期,并获取当前用户的环境信息,您可以
-
-- 获取当前用户的语言、页面主题、user agent 和屏幕状态。
-- 监听页面行为并触发相应事件(页面加载、尺寸变化、页面关闭等)。
-
-另外,该组件还提供了`custom`事件,您可以通过在任意 Javascript 函数中调用`window.ms_globals.dispatch`主动向 Python 端发送事件,在 Python 端可以通过`ms.Application.custom`事件接收。
-
-## 示例
-
-
-
-
-
-
-
-
diff --git a/components/base/application/README.md b/components/base/application/README.md
deleted file mode 100644
index 4972184464b0d6f5885c0fa087dbfabd2a5a3097..0000000000000000000000000000000000000000
--- a/components/base/application/README.md
+++ /dev/null
@@ -1,20 +0,0 @@
-# Application
-
-The root component of the application, this component contains all the component dependencies of `modelscope_studio`. It is necessary to ensure that all components exported from `modelscope_studio` are wrapped by it, otherwise the page will not be successfully previewed.
-
-In addition, this component can also listen to the lifecycle of the user's page and obtain the current user's environment information, you can:
-
-- Obtain the current user's language, page theme, user agent, and screen status.
-- Listen to page behaviors and trigger corresponding events (page loading, size changes, page closing, etc.).
-
-In addition, this component provides the `custom` event, you can send events to the Python side by calling `window.ms_globals.dispatch` in any Javascript function, and receive the events on the Python side through the `ms.Application.custom` event.
-
-## Examples
-
-
-
-
-
-
-
-
diff --git a/components/base/application/app.py b/components/base/application/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/base/application/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/base/application/demos/basic.py b/components/base/application/demos/basic.py
deleted file mode 100644
index 117990bacc10f706d63657574eceb081a97cfb87..0000000000000000000000000000000000000000
--- a/components/base/application/demos/basic.py
+++ /dev/null
@@ -1,13 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- antd.Button("Primary Button", type="primary")
- antd.Divider()
- antd.Input()
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/base/application/demos/custom_event.py b/components/base/application/demos/custom_event.py
deleted file mode 100644
index 709be51c8af279fdc6f92b286951116e5385f4c6..0000000000000000000000000000000000000000
--- a/components/base/application/demos/custom_event.py
+++ /dev/null
@@ -1,19 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-
-def on_custom(e: gr.EventData):
- print(e._data)
-
-
-with gr.Blocks() as demo:
- with ms.Application() as app:
- with antd.ConfigProvider():
- gr.HTML(
- """"""
- )
-
- app.custom(on_custom)
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/base/application/demos/language_adaptation.py b/components/base/application/demos/language_adaptation.py
deleted file mode 100644
index 4aa69717d24957acfe3a298c3c3f732790b0524c..0000000000000000000000000000000000000000
--- a/components/base/application/demos/language_adaptation.py
+++ /dev/null
@@ -1,44 +0,0 @@
-import time
-
-import gradio as gr
-import modelscope_studio.components.base as ms
-
-messages = {
- 'en': {
- "hello": "Hello"
- },
- 'en-US': {
- "hello": "Hello"
- },
- 'zh-CN': {
- "hello": "你好"
- },
- "ja-JP": {
- "hello": "こんにちは"
- },
- "ko-KR": {
- "hello": "안녕하세요"
- }
-}
-
-default_lang = "en"
-
-
-def mount(e: gr.EventData, _state):
- lang = e._data["language"]
- if lang in messages:
- _state["current_lang"] = lang
- yield 'Switch Language...', _state
- time.sleep(2)
- yield messages[_state["current_lang"]]["hello"], _state
-
-
-with gr.Blocks() as demo:
- with ms.Application() as app:
- state = gr.State({"current_lang": default_lang})
- markdown = gr.Markdown(value=messages[default_lang]["hello"])
-
- app.mount(fn=mount, inputs=[state], outputs=[markdown, state])
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/base/application/demos/theme_adaptation.py b/components/base/application/demos/theme_adaptation.py
deleted file mode 100644
index 5ee253797ee58e2334741657788e1daae365b708..0000000000000000000000000000000000000000
--- a/components/base/application/demos/theme_adaptation.py
+++ /dev/null
@@ -1,33 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-
-def mount(e: gr.EventData, _state):
- _state["theme"] = e._data["theme"]
- yield _state
-
-
-def fn(_state):
- theme = _state["theme"]
- color = '000/fff' if theme == 'dark' else 'fff/000'
- yield gr.update(
- value=f"https://dummyimage.com/200x100/{color}.png&text={theme}")
-
-
-with gr.Blocks() as demo:
- state = gr.State({"theme": "light"})
- with ms.Application() as app:
- with antd.ConfigProvider():
- btn = antd.Button(
- "Run",
- type="primary",
- block=True,
- )
- image = antd.Image()
-
- app.mount(fn=mount, inputs=[state], outputs=[state])
- btn.click(fn=fn, inputs=[state], outputs=[image])
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/base/auto_loading/README-zh_CN.md b/components/base/auto_loading/README-zh_CN.md
deleted file mode 100644
index d775c819d7454cfb5edca98b45740de2a1b55df3..0000000000000000000000000000000000000000
--- a/components/base/auto_loading/README-zh_CN.md
+++ /dev/null
@@ -1,35 +0,0 @@
-# AutoLoading 自动加载
-
-在`Gradio`前端发送请求时自动为被包裹的内容添加加载动画。该组件会自动收集子组件的加载状态,建议至少在全局使用一次此组件,以显示兜底的加载反馈。
-
-> **注:** 如果有多个嵌套的`AutoLoading`组件,则只有最内层的`AutoLoading`能收集到子组件的加载状态并展示加载动画。
-
-在`Gradio`中,前端到服务端的请求一共有 4 种状态:
-
-- `pending`:此时前端发出的请求还没有收到服务端的响应。
-- `generating`:此时前端发出的请求已经收到了响应,但是服务端还没有完成所有内容返回(该状态并不是必定发生的,只有当服务端的处理函数使用`yield`返回值时才会存在)。
-- `completed`:服务端返回了所有内容,本次请求结束。
-- `error`:本次请求发生错误。
-
-默认情况下,`AutoLoading`组件会:
-
-- 在请求状态为`pending`时添加加载动画。
-- 在请求状态为`generating`时结束加载动画,此时用户可以手动控制应用的加载效果,您也可以通过设置`generating=True`来继续展示动画。
-- 在请求状态为`completed`时结束加载动画。
-- 在请求状态为`error`时结束加载动画,您可以通过设置`show_error=True`来为用户展示错误信息(该信息会在页面居中显示)。
-
-## 示例
-
-
-
-
-
-## API
-
-| 属性 | 类型 | 默认值 | 描述 |
-| ------------ | ---- | ------ | ---------------------------------------------------------------------------------------- |
-| generating | bool | False | 是否包含对`generating`状态的处理 |
-| show_error | bool | True | 是否显示错误信息 |
-| show_mask | bool | True | 是否显示遮罩 |
-| show_timer | bool | True | 是否显示计时器 |
-| loading_text | str | None | 加载中文案,默认不填写使用 `Gradio` 的加载文案显示(包括加载时间、当前用户的排队队列等) |
diff --git a/components/base/auto_loading/README.md b/components/base/auto_loading/README.md
deleted file mode 100644
index 6e5be586294ad9bad3f99fd953d0c41096085c0a..0000000000000000000000000000000000000000
--- a/components/base/auto_loading/README.md
+++ /dev/null
@@ -1,35 +0,0 @@
-# AutoLoading
-
-Automatically adds loading animations to the wrapped content when requests are sent from the `Gradio` frontend. This component will automatically collect the loading states of child components, it's recommended to use this component at least once globally to provide fallback loading feedback.
-
-> **Note:** If there are multiple nested `AutoLoading` components, only the innermost `AutoLoading` can collect the loading states of child components and display the loading animation.
-
-In `Gradio`, there are 4 states for requests from the frontend to the backend:
-
-- `pending`: The frontend has sent a request but has not yet received a response from the backend.
-- `generating`: The frontend has received a response, but the backend has not completed sending all content (this state does not necessarily occur and only exists when the backend's processing function uses `yield` to return values).
-- `completed`: The backend has returned all content, and the request has ended.
-- `error`: An error occurred during the request.
-
-By default, the `AutoLoading` component will:
-
-- Add a loading animation when the request status is `pending`.
-- End the loading animation when the request status is `generating`. At this point, users can manually control the application's loading effect, or you can set `generating=True` to continue displaying the animation.
-- End the loading animation when the request status is `completed`.
-- End the loading animation when the request status is `error`. You can set `show_error=True` to display error information to the user (this information will be centered on the page).
-
-## Examples
-
-
-
-
-
-## API
-
-| Attribute | Type | Default Value | Description |
-| ------------ | ---- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
-| generating | bool | False | Whether to include handling of the `generating` state |
-| show_error | bool | True | Whether to display error information |
-| show_mask | bool | True | Whether to display the mask |
-| show_timer | bool | True | Whether to display the timer |
-| loading_text | str | None | Loading text, if not filled, it will use the loading text provided by `Gradio` (including loading time, current user's queue position, etc.) |
diff --git a/components/base/auto_loading/app.py b/components/base/auto_loading/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/base/auto_loading/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/base/auto_loading/demos/basic.py b/components/base/auto_loading/demos/basic.py
deleted file mode 100644
index ef278b91b530348408494a7e4d602a1183ea705f..0000000000000000000000000000000000000000
--- a/components/base/auto_loading/demos/basic.py
+++ /dev/null
@@ -1,23 +0,0 @@
-import time
-
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-
-def click():
- time.sleep(2)
- yield gr.update(value="Hello")
-
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with ms.AutoLoading():
- textarea = antd.Input.Textarea()
-
- btn = antd.Button("Click")
- btn.click(click, outputs=[textarea])
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/base/auto_loading/demos/nested.py b/components/base/auto_loading/demos/nested.py
deleted file mode 100644
index 74db11a5cc4eebc9b36e7107b3765f3823de8f30..0000000000000000000000000000000000000000
--- a/components/base/auto_loading/demos/nested.py
+++ /dev/null
@@ -1,42 +0,0 @@
-import time
-
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-
-def click():
- time.sleep(2)
- yield gr.update(value="Hello"), gr.update(value="Hello")
- time.sleep(2)
- yield gr.update(value="Hello World"), gr.update(value="Hello World")
-
-
-def click2():
- time.sleep(2)
- yield gr.update(value="Hello")
-
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with ms.AutoLoading():
- with antd.Space(direction="vertical",
- elem_style=dict(width="100%")):
- with ms.AutoLoading(generating=True):
- textarea = antd.Input.Textarea()
-
- with ms.AutoLoading(show_mask=True):
- textarea2 = antd.Input.Textarea()
-
- textarea3 = antd.Input.Textarea()
-
- with antd.Space():
- btn = antd.Button("Click")
- btn2 = antd.Button("Click2")
-
- btn.click(click, outputs=[textarea, textarea2])
- btn2.click(click2, outputs=[textarea3])
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/base/div/README-zh_CN.md b/components/base/div/README-zh_CN.md
deleted file mode 100644
index 34937273795a16369b70e415f7d9b06e4cd362f7..0000000000000000000000000000000000000000
--- a/components/base/div/README-zh_CN.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Div
-
-同 HTML 中的`div`标签,用于辅助布局,可以绑定常用的 HTML 事件,具体事件请查看`EVENTS`属性。
-
-## 示例
-
-
diff --git a/components/base/div/README.md b/components/base/div/README.md
deleted file mode 100644
index 76615738ad5bd6481f20ef9b5bfa9290defc4186..0000000000000000000000000000000000000000
--- a/components/base/div/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Div
-
-Same as the `div` tag in HTML, used for layout assistance, can bind common HTML events, please refer to the `EVENTS` property for specific events.
-
-## Examples
-
-
diff --git a/components/base/div/app.py b/components/base/div/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/base/div/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/base/div/demos/basic.py b/components/base/div/demos/basic.py
deleted file mode 100644
index d2441ada8b6fc1b642b8ec3fdb120fdf053c014c..0000000000000000000000000000000000000000
--- a/components/base/div/demos/basic.py
+++ /dev/null
@@ -1,10 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with ms.Div(elem_style=dict(color="red", fontSize=22)):
- ms.Text("Hello Div")
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/base/each/README-zh_CN.md b/components/base/each/README-zh_CN.md
deleted file mode 100644
index 4fd5241952e3b519da87c903f54d2912e33fef62..0000000000000000000000000000000000000000
--- a/components/base/each/README-zh_CN.md
+++ /dev/null
@@ -1,30 +0,0 @@
-# Each
-
-辅助渲染组件,该组件支持传入列表作为参数,并会在前端遍历被包裹的组件,将列表的每一项注入当前遍历的上下文中,被包裹的组件属性会在前端被相应的上下文属性替换(只支持从`modelscope_studio`中导出的组件)。
-
-> 注意:在大多数情况下,您不需要使用`Each`组件,如果您需要动态渲染组件,我们更建议您使 Gradio 提供的 [render](https://www.gradio.app/docs/gradio/render) 函数。
-
-## 何时使用
-
-- 当被遍历的组件中全部都是`modelscope_studio`组件或非`modelscope_studio`的组件值不与被遍历的值绑定时;
-- 当需要遍历展示的列表长度无法确定时;
-- 不想要在 Python 中绑定过多事件监听时;
-
-## 示例
-
-
-
-`modelscope_studio`中的每个组件都有一个`as_item`参数(包括`Each`组件本身),指定该参数值后可以直接基于上下文的值做过滤,逻辑上类似`ctx_value = ctx_value["as_item"]`。该特性通常在需要遍历多个组件时使用,可以有效避免属性冲突。
-
-
-
-如果您需要为所有的列表项的组件都添加某些统一的属性,您还可以传入`context_value`参数,该参数会与列表项的上下文深度合并,共同传递给前端组件。
-
-
-
-### API
-
-| 属性 | 类型 | 默认值 | 描述 |
-| ------------- | ---- | ------ | ---------------- |
-| value | list | None | 组件的数据源 |
-| context_value | dict | None | 统一的上下文参数 |
diff --git a/components/base/each/README.md b/components/base/each/README.md
deleted file mode 100644
index ddc30c9f2300f5ae5e14c18d02856d9ec85c1c5c..0000000000000000000000000000000000000000
--- a/components/base/each/README.md
+++ /dev/null
@@ -1,29 +0,0 @@
-# Each
-
-A helper rendering component that supports passing a list as a parameter and will traverse the wrapped components on the front end, injecting each item of the list into the current traversal context. The attributes of the wrapped components will be replaced by corresponding context properties on the front end (only supports components exported from `modelscope_studio`).
-
-> Note: In most cases, you do not need to use the `Each` component. If you need to render components dynamically, we recommend using the [render](https://www.gradio.app/docs/gradio/render) function provided by Gradio.
-
-## When to Use
-
-- When all components being traversed are `modelscope_studio` components or non-`modelscope_studio` components whose values do not bind to the traversed values.
-- When the length of the list to be traversed is uncertain.
-
-## Examples
-
-
-
-Each component within `modelscope_studio` has an `as_item` parameter (including the `Each` component itself). Specifying this parameter value allows filtering based directly on the context value, similar logically to `ctx_value = ctx_value["as_item"]`. This feature is typically used when multiple components need to be iterated over, effectively avoiding property conflicts.
-
-
-
-If you need to add certain unified properties to all list item components, you can also pass in the `context_value` parameter. This parameter will be deeply merged with the list item's context and passed together to the front-end component.
-
-
-
-### API
-
-| Attribute | Type | Default Value | Description |
-| ------------- | ---- | ------------- | ----------------------------- |
-| value | list | None | Data source for the component |
-| context_value | dict | None | Unified context parameters |
diff --git a/components/base/each/app.py b/components/base/each/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/base/each/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/base/each/demos/basic.py b/components/base/each/demos/basic.py
deleted file mode 100644
index da9d8c0da02cae42f79b0885cb2838eae6e451b1..0000000000000000000000000000000000000000
--- a/components/base/each/demos/basic.py
+++ /dev/null
@@ -1,35 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-data = [{
- "message": "Success Text",
- "description":
- "Success Description Success Description Success Description Success Description",
- "type": "success"
-}, {
- "message": "Info Text",
- "description":
- "Info Description Info Description Info Description Info Description",
- "type": "info"
-}, {
- "message": "Warning Text",
- "description":
- "Warning Description Warning Description Warning Description Warning Description",
- "type": "warning"
-}, {
- "message": "Error Text",
- "description":
- "Error Description Error Description Error Description Error Description",
- "type": "error"
-}]
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Space(direction="vertical"):
- with ms.Each(value=data):
- antd.Alert()
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/base/each/demos/use_as_item.py b/components/base/each/demos/use_as_item.py
deleted file mode 100644
index e808ad4e837309b48350a9cff34d3b8255af7c44..0000000000000000000000000000000000000000
--- a/components/base/each/demos/use_as_item.py
+++ /dev/null
@@ -1,69 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-data = [{
- "card": {
- "title": "Success Card Title",
- },
- "each": {
- "value": [{
- "value": "Card Content"
- }, {
- "value": "Card Content"
- }, {
- "value": "Card Content"
- }]
- }
-}, {
- "card": {
- "title": "Info Card Title",
- },
- "each": {
- "value": [{
- "value": "Card Content"
- }, {
- "value": "Card Content"
- }, {
- "value": "Card Content"
- }]
- }
-}, {
- "card": {
- "title": "Warning Card Title",
- },
- "each": {
- "value": [{
- "value": "Card Content"
- }, {
- "value": "Card Content"
- }, {
- "value": "Card Content"
- }]
- }
-}, {
- "card": {
- "title": "Error Card Title",
- },
- "each": {
- "value": [{
- "value": "Card Content"
- }, {
- "value": "Card Content"
- }, {
- "value": "Card Content"
- }]
- }
-}]
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with ms.Each(value=data):
- with antd.Card(as_item="card"):
- # Inner loop
- with ms.Each(as_item="each"):
- antd.Typography.Paragraph()
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/base/each/demos/use_context_value.py b/components/base/each/demos/use_context_value.py
deleted file mode 100644
index ccd87c7fdf11c46b4052798a19e53a074f4e06a7..0000000000000000000000000000000000000000
--- a/components/base/each/demos/use_context_value.py
+++ /dev/null
@@ -1,72 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-data = [{
- "card": {
- "title": "Success Card Title",
- },
- "each": {
- "value": [{
- "value": "Card Content"
- }, {
- "value": "Card Content"
- }, {
- "value": "Card Content"
- }]
- }
-}, {
- "card": {
- "title": "Info Card Title",
- },
- "each": {
- "value": [{
- "value": "Card Content"
- }, {
- "value": "Card Content"
- }, {
- "value": "Card Content"
- }]
- }
-}, {
- "card": {
- "title": "Warning Card Title",
- },
- "each": {
- "value": [{
- "value": "Card Content"
- }, {
- "value": "Card Content"
- }, {
- "value": "Card Content"
- }]
- }
-}, {
- "card": {
- "title": "Error Card Title",
- },
- "each": {
- "value": [{
- "value": "Card Content"
- }, {
- "value": "Card Content"
- }, {
- "value": "Card Content"
- }]
- }
-}]
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with ms.Each(value=data,
- context_value={"card": {
- "hoverable": True
- }}):
- with antd.Card(as_item="card"):
- # Inner loop
- with ms.Each(as_item="each"):
- antd.Typography.Paragraph()
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/base/filter/README-zh_CN.md b/components/base/filter/README-zh_CN.md
deleted file mode 100644
index 488c422f034eaefdeb24f7c21810bb78df4716bd..0000000000000000000000000000000000000000
--- a/components/base/filter/README-zh_CN.md
+++ /dev/null
@@ -1,21 +0,0 @@
-# Filter
-
-辅助渲染组件,该组件需要与`Each`组件配合使用,用于过滤`Each`组件中的上下文信息。
-
-该组件的`as_item`参数有所不同,它会将过滤后的上下文信息作为基础继续往下传递,适合在多个模块组件的`Each`组件遍历中使用。
-
-同时,您也可以传入`params_mapping`参数,该参数允许用户通过 Javascript 函数的形式自定义过滤上下文信息。
-
-而如果不传入任何参数,该组件会阻断`Each`组件的上下文传递,让属性的覆盖失效。
-
-## 示例
-
-
-
-
-
-
-
-### API
-
-| Property | Type | Default Value | Description |
-| -------------- | ---- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
-| params_mapping | str | None | This value is a string of a Javascript function, allowing users to customize the filtering of context information via a JavaScript function. |
diff --git a/components/base/filter/app.py b/components/base/filter/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/base/filter/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/base/filter/demos/basic.py b/components/base/filter/demos/basic.py
deleted file mode 100644
index 9e4608434b5162b6a20420f021ed8fb83f87d875..0000000000000000000000000000000000000000
--- a/components/base/filter/demos/basic.py
+++ /dev/null
@@ -1,20 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-data = [{"value": "Hello"}, {"value": "World"}]
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Space(direction="vertical"):
- antd.Divider("Without Filter")
- with ms.Each(value=data):
- antd.Button()
- antd.Divider("With Filter")
- with ms.Each(value=data):
- with ms.Filter():
- antd.Button("Run")
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/base/filter/demos/use_as_item.py b/components/base/filter/demos/use_as_item.py
deleted file mode 100644
index 6257d708a3a1fe2ae33a9d6d439f21c905d71e5f..0000000000000000000000000000000000000000
--- a/components/base/filter/demos/use_as_item.py
+++ /dev/null
@@ -1,27 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-data = [{
- "title": "Card Title",
- "btn": {
- "value": "Hello"
- }
-}, {
- "title": "Card Title",
- "btn": {
- "value": "World"
- }
-}]
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Space(direction="vertical"):
- with ms.Each(value=data):
- with antd.Card():
- with ms.Filter(as_item="btn"):
- antd.Button()
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/base/filter/demos/use_params_mapping.py b/components/base/filter/demos/use_params_mapping.py
deleted file mode 100644
index 9f87e9ec8297759a36e24211f629eb8c91e3e0e5..0000000000000000000000000000000000000000
--- a/components/base/filter/demos/use_params_mapping.py
+++ /dev/null
@@ -1,26 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-data = [{
- "title": "Card Title",
- "desc": "Hello"
-}, {
- "title": "Card Title",
- "desc": "World"
-}]
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Space(direction="vertical"):
- with ms.Each(value=data):
- with antd.Card():
- with ms.Filter(
- params_mapping=
- """(props) => ({ value: props.desc, type: props.desc === 'World' ? 'primary' : 'default' })"""
- ):
- antd.Button()
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/base/fragment/README-zh_CN.md b/components/base/fragment/README-zh_CN.md
deleted file mode 100644
index 23b19fa74a39de85ea55f29f87ad1b49abf76a1f..0000000000000000000000000000000000000000
--- a/components/base/fragment/README-zh_CN.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# Fragment 片段
-
-分段组件,该组件本身不会参与页面布局,它的主要作用是组合多个子组件,并将它们共同包装为`modelscope_studio`组件。
-
-> 部分组件的插槽仅支持从`modelscope_studio`中导出的组件,如果您需要插入其他组件,就需要使用`Fragment`组件进行包裹。
-
-## 示例
-
-
diff --git a/components/base/fragment/README.md b/components/base/fragment/README.md
deleted file mode 100644
index 02bc4b456ec28e2c32cf3ce4b6420bff658ed911..0000000000000000000000000000000000000000
--- a/components/base/fragment/README.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# Fragment
-
-A fragment component that does not participate in page layout itself. Its main purpose is to combine multiple child components and wrap them together as a `modelscope_studio` component.
-
-> Some component slots only support components exported from `modelscope_studio`. If you need to insert other components, you'll need to wrap them with the `Fragment` component.
-
-## Examples
-
-
diff --git a/components/base/fragment/app.py b/components/base/fragment/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/base/fragment/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/base/fragment/demos/basic.py b/components/base/fragment/demos/basic.py
deleted file mode 100644
index 39e1b5b1f8310367389e15b8c6ed6887a64dcaa9..0000000000000000000000000000000000000000
--- a/components/base/fragment/demos/basic.py
+++ /dev/null
@@ -1,21 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- antd.Divider("Without Fragment")
- with antd.Space():
- antd.Button("Antd Button")
- antd.Button("Antd Button")
- gr.Button("Gradio Button")
- antd.Divider("With Fragment")
- with antd.Space():
- antd.Button("Antd Button")
- antd.Button("Antd Button")
- with ms.Fragment():
- gr.Button("Gradio Button")
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/base/markdown/README-zh_CN.md b/components/base/markdown/README-zh_CN.md
deleted file mode 100644
index a9ff4bee051f33329aa8d5d07f91b6545bec3ae8..0000000000000000000000000000000000000000
--- a/components/base/markdown/README-zh_CN.md
+++ /dev/null
@@ -1,12 +0,0 @@
-# Markdown
-
-与`gr.Markdown`的参数和表现形式基本一致,并同时拥有`modelscope_studio`组件特性,可以用于在部分具有参数的`Slot`中插入 Markdown 文本。
-
-额外特性:
-
-- 可以自定义拷贝按钮的样式。
-
-## 示例
-
-
-
diff --git a/components/base/markdown/README.md b/components/base/markdown/README.md
deleted file mode 100644
index 314599bf9cb4f94f5c4f17da608b589b46c6b275..0000000000000000000000000000000000000000
--- a/components/base/markdown/README.md
+++ /dev/null
@@ -1,12 +0,0 @@
-# Markdown
-
-Consistent with the parameters and appearance of `gr.Markdown`, it also has the features of the `modelscope_studio` components and can be used to insert Markdown text into some `Slot` elements that have parameters.
-
-Additional Features:
-
-- Can customize the style of the copy button.
-
-## Examples
-
-
-
diff --git a/components/base/markdown/app.py b/components/base/markdown/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/base/markdown/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/base/markdown/demos/basic.py b/components/base/markdown/demos/basic.py
deleted file mode 100644
index 28d95fc57654ec0a1e5585cd3084aa9057d02aa3..0000000000000000000000000000000000000000
--- a/components/base/markdown/demos/basic.py
+++ /dev/null
@@ -1,9 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- ms.Markdown("`Hello Markdown`")
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/base/markdown/demos/custom_copy_buttons.py b/components/base/markdown/demos/custom_copy_buttons.py
deleted file mode 100644
index 7bed3712fd8f4fe6e1d8da955bca308973b4315b..0000000000000000000000000000000000000000
--- a/components/base/markdown/demos/custom_copy_buttons.py
+++ /dev/null
@@ -1,20 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- ms.Markdown("`Hello Markdown`", show_copy_button=True)
- antd.Divider()
- with ms.Markdown("`Hello Markdown`", show_copy_button=True):
- with ms.Slot("copyButtons"):
- with antd.Button(value=None, size="small"):
- with ms.Slot("icon"):
- antd.Icon("CopyOutlined")
- with antd.Button(value=None, size="small"):
- with ms.Slot("icon"):
- antd.Icon("CheckOutlined")
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/base/slot/README-zh_CN.md b/components/base/slot/README-zh_CN.md
deleted file mode 100644
index 998a74918b765f062ccb1241467a63bac6b989fe..0000000000000000000000000000000000000000
--- a/components/base/slot/README-zh_CN.md
+++ /dev/null
@@ -1,16 +0,0 @@
-# Slot 插槽
-
-插槽组件,需要与`modelscope_studio`中的其他组件一起使用,可以传入指定插槽名称,从而将该组件插入到目标组件的指定位置。
-
-`modelscope_studio`中组件的插槽可以通过获取`SLOTS`属性查看。
-
-## 示例
-
-
-
-### API
-
-| 属性 | 类型 | 默认值 | 描述 |
-| -------------- | ---- | ------ | -------------------------------------------------------------------------------------------------------------------------- |
-| value | str | None | 插槽名称 |
-| params_mapping | str | None | 该值为一个 Javascript 的函数字符串,当对应插槽可以接受参数时,通过此参数可以将参数映射为插槽的上下文,具体请参考`Each`组件 |
diff --git a/components/base/slot/README.md b/components/base/slot/README.md
deleted file mode 100644
index a8c4fc4b3711f1de85c17797aed8fb12be96c8b4..0000000000000000000000000000000000000000
--- a/components/base/slot/README.md
+++ /dev/null
@@ -1,16 +0,0 @@
-# Slot
-
-A slot component that needs to be used with other components in `modelscope_studio`. You can pass in a specified slot name to insert this component into the specified position of the target component.
-
-The slots of components in `modelscope_studio` can be viewed by getting the `SLOTS` property.
-
-## Examples
-
-
-
-### API
-
-| Attribute | Type | Default Value | Description |
-| -------------- | ---- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
-| value | str | None | Slot name |
-| params_mapping | str | None | This value is a string of a Javascript function. When the corresponding slot can accept parameters, the parameters can be mapped to the slot context through this parameter, please refer to the `Each` component for details. |
diff --git a/components/base/slot/app.py b/components/base/slot/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/base/slot/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/base/slot/demos/basic.py b/components/base/slot/demos/basic.py
deleted file mode 100644
index d9f8694ae8424b271fa30ef120460a88adfee6fc..0000000000000000000000000000000000000000
--- a/components/base/slot/demos/basic.py
+++ /dev/null
@@ -1,22 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.antd as antd
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with antd.ConfigProvider():
- with antd.Card():
- ms.Div("Card Content")
- ms.Div("Card Content")
- ms.Div("Card Content")
- # slots
- with ms.Slot("title"):
- ms.Text("Card Title")
- with ms.Slot("extra"):
- with antd.Button():
- ms.Text("GitHub")
- with ms.Slot("icon"):
- antd.Icon("GithubOutlined")
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/base/span/README-zh_CN.md b/components/base/span/README-zh_CN.md
deleted file mode 100644
index 22ed1ed9096a5c8522eabb24405352b5e6ed49aa..0000000000000000000000000000000000000000
--- a/components/base/span/README-zh_CN.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Span
-
-同 HTML 中的`span`标签,用于辅助布局,可以绑定常用的 HTML 事件,具体事件请查看`EVENTS`属性。
-
-## 示例
-
-
diff --git a/components/base/span/README.md b/components/base/span/README.md
deleted file mode 100644
index df2c4b44d048442d1ce4a6c3c6f72a985470c18f..0000000000000000000000000000000000000000
--- a/components/base/span/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Span
-
-Same as the `span` tag in HTML, used for layout assistance, can bind common HTML events, please refer to the `EVENTS` property for specific events.
-
-## Examples
-
-
diff --git a/components/base/span/app.py b/components/base/span/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/base/span/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/base/span/demos/basic.py b/components/base/span/demos/basic.py
deleted file mode 100644
index 3cbe9918f8bac3a031fa260722e557b4c28d6f96..0000000000000000000000000000000000000000
--- a/components/base/span/demos/basic.py
+++ /dev/null
@@ -1,10 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- with ms.Span(elem_style=dict(color="red", fontSize=22)):
- ms.Text("Hello Span")
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/base/text/README-zh_CN.md b/components/base/text/README-zh_CN.md
deleted file mode 100644
index d932c34b67fdce11570727db7d7c0011b85e192b..0000000000000000000000000000000000000000
--- a/components/base/text/README-zh_CN.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Text
-
-纯文本字符串,类似 HTML 中的`textNode`,用于辅助布局。
-
-## 示例
-
-
diff --git a/components/base/text/README.md b/components/base/text/README.md
deleted file mode 100644
index 902e8054c450cbe7cc2edca45dd5de7236bf8a6c..0000000000000000000000000000000000000000
--- a/components/base/text/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Text
-
-Plain text string, similar to `textNode` in HTML, used for layout assistance.
-
-## Examples
-
-
diff --git a/components/base/text/app.py b/components/base/text/app.py
deleted file mode 100644
index 0018b7c1d02f97731da6e29c06bb4ebb0326d3e9..0000000000000000000000000000000000000000
--- a/components/base/text/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from helper.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/base/text/demos/basic.py b/components/base/text/demos/basic.py
deleted file mode 100644
index bac12f30695c67fdb34c8b23aa67e326c6197be2..0000000000000000000000000000000000000000
--- a/components/base/text/demos/basic.py
+++ /dev/null
@@ -1,9 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.base as ms
-
-with gr.Blocks() as demo:
- with ms.Application():
- ms.Text("Hello Text")
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/legacy/Chatbot/app.py b/components/legacy/Chatbot/app.py
deleted file mode 100644
index ea841f78832d9254426dc781674f7e39f7f7fd2f..0000000000000000000000000000000000000000
--- a/components/legacy/Chatbot/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from components.legacy.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/legacy/Chatbot/demos/chart.py b/components/legacy/Chatbot/demos/chart.py
deleted file mode 100644
index e73cf301bf7eaaa9a2609b0a304c7f6c0088ad43..0000000000000000000000000000000000000000
--- a/components/legacy/Chatbot/demos/chart.py
+++ /dev/null
@@ -1,43 +0,0 @@
-import json
-
-import gradio as gr
-import modelscope_studio.components.base as ms
-import modelscope_studio.components.legacy as mgr
-
-# echarts options, see: https://echarts.apache.org/en/index.html
-option1 = {
- "xAxis": {
- "type": 'category',
- "data": ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
- },
- "yAxis": {
- "type": 'value',
- },
- "series": [
- {
- "data": [150, 230, 224, 218, 135, 147, 260],
- "type": 'line',
- },
- ],
-}
-
-conversation = [
- [
- None, {
- "text": f"""
-Chart:
-
-"""
- }
- ],
-]
-
-with gr.Blocks() as demo, ms.Application():
- mgr.Chatbot(
- value=conversation,
- flushing=False,
- height=600,
- )
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/legacy/Flow/README-zh_CN.md b/components/legacy/Flow/README-zh_CN.md
deleted file mode 100644
index 0c4afb7e97c43aaa3d69acdaacdae787a32d4892..0000000000000000000000000000000000000000
--- a/components/legacy/Flow/README-zh_CN.md
+++ /dev/null
@@ -1,109 +0,0 @@
-# Flow
-
-基于 [reactflow](https://reactflow.dev/) 实现的 Flow 组件。
-
-- 支持通过 schema 自定义渲染节点
-- 支持自定义节点的渲染组件,并与 Python 事件交互
-
-## 如何使用
-
-### 定义 schema 节点 (重要)
-
-详见:Define Schema
-
-### 基本使用
-
-
-
-### 组件配置项
-
-
-
-### 自定义节点类型(高阶用法,需要了解前端知识)
-
-
-
-## API 及参数列表
-
-### value
-
-接口定义:
-
-```python
-class NodePosition(GradioModel):
- x: Optional[int] = 0
- y: Optional[int] = 0
-
-
-class Node(GradioModel):
- id: Optional[str] = None
- name: str
- title: Optional[str] = None
- position: Optional[Union[NodePosition, dict]] = None
- data: Optional[dict] = None
-
-class EdgePort(GradioModel):
- attr: Optional[str] = None
- attrItemIndex: Optional[int] = None
- handleIndex: Optional[int] = None
-
-class Edge(GradioModel):
- id: Optional[str] = None
- source: str
- target: str
- sourcePort: Optional[Union[EdgePort, dict]] = None
- targetPort: Optional[Union[EdgePort, dict]] = None
-
-
-class FlowData(GradioModel):
- nodes: Optional[List[Union[Node, dict]]] = []
- edges: Optional[List[Union[Edge, dict]]] = []
-
-```
-
-### props
-
-| 属性 | 类型 | 默认值 | 描述 |
-| ------------------- | --------------------------------------------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| height | int \| str | 600 | Flow 组件高度。 |
-| sync_on_data_change | bool | None | 是否仅在数据更改时同步 Python 值(例如:节点属性、节点计数、边缘计数、连接端口等,不包括节点位置)。 如果您想要更好的页面性能而不是完整数据同步,则应将其设置为 True。 |
-| schema | FlowSchemaDict \| dict | None | 定义 Flow 组件的 nodes 与 edges。 |
-| show_sidebar | bool | True | 是否展示侧 Flow 组件侧边栏。 |
-| show_minimap | bool | True | 是否展示侧 Flow 组件小地图。 |
-| show_controls | bool | True | 是否展示侧Flow 组件控制栏。 |
-| background_props | BackgroundPropsDict \| dict CustomComponentDict 定义见下方 | None | 修改 Flow组件背景,详见 BackgroundPropsDict 类型。 |
-| min_zoom | int | 0.1 | Flow 组件最小缩放倍率。 |
-| max_zoom | int | 2 | Flow 组件最大缩放倍率。 |
-| custom_components | dict\[str, CustomComponentDict\] CustomComponentDict 定义见下方 | None | 支持用户自定义节点类型,并通过 js 控制渲染样式与触发 python 事件。 |
-
-**BackgroundPropsDict 定义如下**
-
-```python
-class BackgroundPropsDict(TypedDict):
- color: Optional[str]
- className: Optional[str]
- # The gap between patterns. Passing in a tuple allows you to control the x and y gap independently.
- gap: Optional[Union[int, Tuple[int, int]]]
- # The radius of each dot or the size of each rectangle if BackgroundVariant.Dots or BackgroundVariant.Cross is used. This defaults to 1 or 6 respectively, or ignored if BackgroundVariant.Lines is used.
- size: Optional[int]
- offset: Optional[int]
- lineWidth: Optional[int]
- variant: Optional[Literal['dots', 'lines', 'cross']]
-```
-
-**CustomComponentDict 定义如下**
-
-```python
-class CustomComponentDict(TypedDict):
- props: Optional[List[str]]
- template: Optional[str]
- js: Optional[str]
-```
-
-### event listeners
-
-| 事件 | 描述 |
-| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
-| `mgr.Flow.change(fn, ···)` | 当 value 更新时触发,如果 sync_on_data_change 值为 True 时,此时 flow 的实际数据可能并不是实时的,建议监听 data_change 事件。 |
-| `mgr.Flow.data_change(fn, ···)` | 当在数据更改时触发(例如:节点属性、节点计数、边缘计数、连接端口等,不包括节点位置) |
-| `mgr.Flow.custom(fn, ···)` | 自定义标签触发事件时触发,EventData 为: - id:当前触发节点 id。 - node:当前触发节点类型。 - attr:当前触发节点属性。 - index:当前触发节点属性索引,当节点属性为 list 时有值。 - value:自定义传入的值。 |
diff --git a/components/legacy/Flow/README.md b/components/legacy/Flow/README.md
deleted file mode 100644
index b7ebf875a609b8127407d48177bb836b692f4d46..0000000000000000000000000000000000000000
--- a/components/legacy/Flow/README.md
+++ /dev/null
@@ -1,108 +0,0 @@
-# Flow
-
-A Flow component implemented based on [reactflow](https://reactflow.dev/).
-
-- Supports customization of node rendering through a schema.
-- Allows for custom node render components with interaction from Python.
-
-## How to Use
-
-### Defining Schema Nodes (Important)
-
-See: Define Schema
-
-### Basic Usage
-
-
-
-### Component Options
-
-
-
-### Custom Node Types (Advanced usage, requires frontend knowledge)
-
-
-
-## API and Parameter List
-
-### value
-
-Interface definition:
-
-```python
-class NodePosition(GradioModel):
- x: Optional[int] = 0
- y: Optional[int] = 0
-
-
-class Node(GradioModel):
- id: Optional[str] = None
- name: str
- title: Optional[str] = None
- position: Optional[Union[NodePosition, dict]] = None
- data: Optional[dict] = None
-
-class EdgePort(GradioModel):
- attr: Optional[str] = None
- attrItemIndex: Optional[int] = None
- handleIndex: Optional[int] = None
-
-class Edge(GradioModel):
- id: Optional[str] = None
- source: str
- target: str
- sourcePort: Optional[Union[EdgePort, dict]] = None
- targetPort: Optional[Union[EdgePort, dict]] = None
-
-
-class FlowData(GradioModel):
- nodes: Optional[List[Union[Node, dict]]] = []
- edges: Optional[List[Union[Edge, dict]]] = []
-```
-
-### props
-
-| Attribute | Type | Default Value | Description |
-| ------------------- | --------------------------------------------------------------------- | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| height | int \| str | 600 | Height of the Flow component. |
-| sync_on_data_change | bool | None | Whether to sync the Python value only on data change (e.g., node attributes, node count, edge count, connection ports, not including node positions). If you want better page performance without full data sync, set this to True. |
-| schema | FlowSchemaDict \| dict | None | Defines the nodes and edges of the Flow component. |
-| show_sidebar | bool | True | Whether to display the sidebar in the Flow component. |
-| show_minimap | bool | True | Whether to display the minimap in the Flow component. |
-| show_controls | bool | True | Whether to display the controls bar in the Flow component. |
-| background_props | BackgroundPropsDict \| dict BackgroundPropsDict definition below | None | Modify the background of the Flow component, see the BackgroundPropsDict type. |
-| min_zoom | int | 0.1 | Minimum zoom level for the Flow component. |
-| max_zoom | int | 2 | Maximum zoom level for the Flow component. |
-| custom_components | dict\[str, CustomComponentDict\] CustomComponentDict definition below | None | Supports user-defined custom tags and controls tag rendering styles and triggers Python events through js. |
-
-**BackgroundPropsDict definition:**
-
-```python
-class BackgroundPropsDict(TypedDict):
- color: Optional[str]
- className: Optional[str]
- # The gap between patterns. Passing in a tuple allows you to control the x and y gap independently.
- gap: Optional[Union[int, Tuple[int, int]]]
- # The radius of each dot or the size of each rectangle if BackgroundVariant.Dots or BackgroundVariant.Cross is used. This defaults to 1 or 6 respectively, or ignored if BackgroundVariant.Lines is used.
- size: Optional[int]
- offset: Optional[int]
- lineWidth: Optional[int]
- variant: Optional[Literal['dots', 'lines', 'cross']]
-```
-
-**CustomComponentDict definition:**
-
-```python
-class CustomComponentDict(TypedDict):
- props: Optional[List[str]]
- template: Optional[str]
- js: Optional[str]
-```
-
-### Event Listeners
-
-| Event | Description |
-| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
-| `mgr.Flow.change(fn, ...)` | Triggers when the `value` updates. If `sync_on_data_change` is True, the actual data at this point might not be up-to-date; consider listening to the `data_change` event instead. |
-| `mgr.Flow.data_change(fn, ...)` | Triggers when there's a data change (e.g., node attributes, node count, edge count, connection ports), but not node positions. |
-| `mgr.Flow.custom(fn, ...)` | Triggers when a custom label event occurs. The `EventData` includes: - `id`: ID of the currently triggered node. - `node`: Type of the currently triggered node. - `attr`: Attributes of the currently triggered node. - `index`: Index of the attribute if it's a list. - `value`: Custom passed-in value. |
diff --git a/components/legacy/Flow/app.py b/components/legacy/Flow/app.py
deleted file mode 100644
index ea841f78832d9254426dc781674f7e39f7f7fd2f..0000000000000000000000000000000000000000
--- a/components/legacy/Flow/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from components.legacy.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/legacy/Flow/define_schema-zh_CN.md b/components/legacy/Flow/define_schema-zh_CN.md
deleted file mode 100644
index dfd15303d31764b01c8170275d0d91b43f61dfe5..0000000000000000000000000000000000000000
--- a/components/legacy/Flow/define_schema-zh_CN.md
+++ /dev/null
@@ -1,266 +0,0 @@
-# Define Schema
-
-在使用 Flow 组件前,需要预先创建 Schema 定义 node 节点,schema 类型定义如下:
-
-```ts
-export interface FlowSchema {
- nodes: FlowNodeSchema[];
-}
-
-export interface FlowNodeSchema {
- /**
- * 作为节点的唯一标识。必填。
- */
- name: string;
-
- /**
- * 节点显示图标。
- */
- icon?: string;
-
- /**
- * 节点标题,如果没有提供则默认使用 name。
- */
- title?: string;
-
- /**
- * 节点的简短描述。
- */
- description?: string;
-
- /**
- * 节点宽度。
- */
- width?: number;
-
- /**
- * 节点高度。
- */
- height?: number;
-
- /**
- * 显示/隐藏工具栏(删除、复制、重命名等)。
- * @default true
- */
- show_toolbar?: boolean;
-
- /**
- * 启用/禁止添加更多此类节点实例。
- * @default true
- */
- addable?: boolean;
-
- /**
- * 启用/禁止删除现有此类节点实例。
- * @default true
- */
- deletable?: boolean;
-
- /**
- * 可以同时存在的此类节点的最大数量。
- */
- max?: number;
-
- /**
- * 可以同时存在的此类节点的最小数量。
- */
- min?: number;
-
- /**
- * 节点连接端口的配置。
- */
- ports?: {
- /**
- * 节点作为连接的源端口。
- * @default ['right']
- */
- source?: Position[];
-
- /**
- * 允许此节点 source 端口连接到的其他节点或属性。默认为所有节点和属性。
- * @default []
- */
- sourceConnections?: PortConnection[];
-
- /**
- * 节点作为连接的目标端口。
- * @default ['left']
- */
- target?: Position[];
-
- /**
- * 其他允许连接到此节点 target 端口的节点或属性。默认为所有节点和属性
- * @default []
- */
- targetConnections?: PortConnection[];
- };
-
- /**
- * 节点的属性配置。
- */
- attrs?: FlowNodeAttrSchema[];
-
- /**
- * 创建新实例时节点属性的初始值。
- */
- template?: {
- /**
- * 在`attrs`字段中与其名称相对应的属性值,例如 { "a": 1, "b": 2 }。
- */
- attrs?: Attrs;
- };
-}
-
-export interface FlowNodeAttrSchema {
- /**
- * 唯一的属性名称,在 node data 中用作 key。必填。
- */
- name: string;
-
- /**
- * 属性标题,如果没有提供则默认使用 name。
- */
- title?: string;
-
- /**
- * 属性的简短描述
- */
- description?: string;
-
- /**
- * 禁用用户编辑属性值。默认情况下,属性是可编辑的。
- * @default false
- */
- disabled?: boolean;
-
- /**
- * 属性输入类型。可以是内置的 Ant Design 组件或自定义组件之一。默认为'input'。
- * @default 'input'
- */
- type?:
- | 'input'
- | 'textarea'
- | 'radio'
- | 'checkbox'
- | 'number'
- | 'select'
- | 'switch'
- | 'upload'
- // 自定义
- | (string & {});
-
- /**
- * 针对所选组件类型的特定配置选项,支持 Ant Design 组件({@link https://ant.design/components/overview/})或自定义组件的属性。
- */
- props?: Record;
-
- /**
- * 节点属性连接端口的配置。
- */
- ports?: {
- /**
- * 节点属性作为连接的源端口。
- * @default []
- */
- source?: Position[];
-
- /**
- * 允许此节点属性 source 端口连接到的其他节点或属性。
- * @default []
- */
- sourceConnections?: PortConnection[];
-
- /**
- * 节点属性作为连接的目标端口。
- * @default []
- */
- target?: Position[];
-
- /**
- * 其他允许连接到此节点属性 target 端口的节点或属性。
- * @default []
- */
- targetConnections?: PortConnection[];
- };
-
- /**
- * 表示该属性是否为列表值。
- * @default false
- */
- list?:
- | boolean
- | {
- /**
- * 列表中每个 item 的端口配置。
- */
- ports?: {
- /**
- * 列表 item 作为连接的源端口。
- * @default []
- */
- source?: Position[];
-
- /**
- * 允许此列表 item source 端口连接到的其他节点或属性。
- * @default []
- */
- sourceConnections?: PortConnection[];
-
- /**
- * 列表 item 作为连接的目标端口。
- */
- target?: Position[];
-
- /**
- * 其他允许连接到此列表 item target 端口的节点或属性。
- */
- targetConnections?: PortConnection[];
- };
-
- /**
- * 列表中的最小 item 数量。
- */
- min?: number;
-
- /**
- * 列表中的最大 item 数量。
- */
- max?: number;
- };
-
- /**
- * 启用/禁用手风琴 UI。
- * @default true
- */
- accordion?: boolean;
-
- /**
- * 指定该属性值是否为必填项。默认情况为非必填项。
- * @default false
- */
- required?:
- | boolean
- | {
- message?: string;
- };
-
- /**
- * 使用 JSON schema 验证属性值。
- */
- json_schema_validator?: Record;
-}
-```
-
-你可以通过 json 文件(推荐)或直接在 Python 端通过导出类型定义:
-
-- 通过 json 定义:
-
-```json
-
-```
-
-- 通过 Python 定义:
-
-```python
-
-```
diff --git a/components/legacy/Flow/define_schema.md b/components/legacy/Flow/define_schema.md
deleted file mode 100644
index bb2c78c17655240097841083b9feec32981b13a5..0000000000000000000000000000000000000000
--- a/components/legacy/Flow/define_schema.md
+++ /dev/null
@@ -1,262 +0,0 @@
-# Define Schema
-
-Before using the Flow component, need to create a Schema definition node in advance. The schema type is defined as follows:
-
-```ts
-export interface FlowSchema {
- nodes: FlowNodeSchema[];
-}
-
-export interface FlowNodeSchema {
- /**
- * As a unique identifier for the node. Mandatory.
- */
- name: string;
-
- /**
- * Display icon for the node.
- */
- icon?: string;
-
- /**
- * Display title for the node, defaults to the node name if not provided.
- */
- title?: string;
-
- /**
- * A short description of the node's purpose.
- */
- description?: string;
-
- /**
- * Width of the node.
- */
- width?: number;
-
- /**
- * Height of the node.
- */
- height?: number;
-
- /**
- * Shows/hides the toolbar (delete, copy, rename, etc.).
- * @default true
- */
- show_toolbar?: boolean;
-
- /**
- * Enables/disables adding more instances of this node.
- * @default true
- */
- addable?: boolean;
-
- /**
- * Enables/disables deleting existing instances of this node.
- * @default true
- */
- deletable?: boolean;
-
- /**
- * Maximum number of this node type that can exist simultaneously.
- */
- max?: number;
-
- /**
- * Minimum number of this node type that must exist simultaneously.
- */
- min?: number;
-
- /**
- * Configurations for the node's connection ports.
- */
- ports?: {
- /**
- * Source ports for the node as a connection.
- * @default ['right']
- */
- source?: Position[];
-
- /**
- * Allowed the source ports of this node to connect to other nodes or attributes. Defaults to all nodes and attributes
- */
- sourceConnections?: PortConnection[];
-
- /**
- * Target ports for the node as a connection
- * @default ['left']
- */
- target?: Position[];
-
- /**
- * Allowed other nodes or attributes allowed to connect to the target ports of this node. Defaults to all nodes and attributes
- *
- */
- targetConnections?: PortConnection[];
- };
-
- /**
- * Configuration of the node's attributes.
- */
- attrs?: FlowNodeAttrSchema[];
-
- /**
- * Initial values for the node's attributes when creating a new instance.
- */
- template?: {
- /**
- * Attribute values corresponding to their names in the `attrs` field, e.g., `{ "a": 1, "b": 2 }`.
- */
- attrs?: Attrs;
- };
-}
-
-export interface FlowNodeAttrSchema {
- /**
- * Unique attribute name used as a key in the node data. Mandatory.
- */
- name: string;
-
- /**
- * Display title for the attribute, defaults to the attribute name if not provided.
- */
- title?: string;
-
- /**
- * A brief explanation about the attribute purpose.
- */
- description?: string;
-
- /**
- * Disables user editing of the attribute value. By default, attributes are editable.
- * @default false
- */
- disabled?: boolean;
-
- /**
- * Attribute input type. Can be one of the built-in Ant Design components or a custom component. Defaults to 'input'.
- * @default 'input'
- */
- type?:
- | 'input'
- | 'textarea'
- | 'radio'
- | 'checkbox'
- | 'number'
- | 'select'
- | 'switch'
- | 'upload'
- // custom
- | (string & {});
-
- /**
- * Configuration options specific to the chosen component type, supporting Ant Design ({@link https://ant.design/components/overview/}) or custom component properties.
- */
- props?: Record;
-
- /**
- * Configurations for the node attribute ports.
- */
- ports?: {
- /**
- * Source ports for the attribute as a connection.
- * @default []
- */
- source?: Position[];
-
- /**
- * Allowed the source ports of this attribute to connect to other nodes or attributes. Defaults to all nodes and attributes
- */
- sourceConnections?: PortConnection[];
-
- /**
- * Target ports for the attribute as a connection
- * @default []
- */
- target?: Position[];
-
- /**
- * Allowed other nodes or attributes allowed to connect to the target ports of this attribute. Defaults to all nodes and attributes
- */
- targetConnections?: PortConnection[];
- };
-
- /**
- * Indicates whether the attribute is a list.
- * @default false
- */
- list?:
- | boolean
- | {
- /**
- * Port configurations for each item in the list.
- */
- ports?: {
- /**
- * Source ports for the list item as a connection.
- * @default []
- */
- source?: Position[];
-
- /**
- * Allowed the source ports of this list item to connect to other nodes or attributes. Defaults to all nodes and attributes
- */
- sourceConnections?: PortConnection[];
-
- /**
- * Target ports for the list item as a connection
- */
- target?: Position[];
-
- /**
- * Allowed other nodes or attributes allowed to connect to the target ports of this list item. Defaults to all nodes and attributes
- */
- targetConnections?: PortConnection[];
- };
-
- /**
- * Minimum number of items in the list.
- */
- min?: number;
-
- /**
- * Maximum number of items in the list.
- */
- max?: number;
- };
-
- /**
- * Enable/disable accordion UI.
- * @default true
- */
- accordion?: boolean;
-
- /**
- * Specifies if the attribute value is mandatory. By default, attributes are optional.
- * @default false
- */
- required?:
- | boolean
- | {
- message?: string;
- };
-
- /**
- * Validates attribute values using JSON schema.
- */
- json_schema_validator?: Record;
-}
-```
-
-You can define the schema by a json file (recommended) or directly on the Python by the exported types:
-
-- Defined by json:
-
-```json
-
-```
-
-- Defined by Python:
-
-```python
-
-```
diff --git a/components/legacy/Flow/demos/basic.py b/components/legacy/Flow/demos/basic.py
deleted file mode 100644
index 48f18eff6e59b11bd40890a7e4d25a5a42799074..0000000000000000000000000000000000000000
--- a/components/legacy/Flow/demos/basic.py
+++ /dev/null
@@ -1,35 +0,0 @@
-import json
-import os
-
-import gradio as gr
-import modelscope_studio.components.base as ms
-import modelscope_studio.components.legacy as mgr
-from modelscope_studio.components.legacy.Flow import Edge, Node
-
-with open((os.path.join(os.path.dirname(__file__),
- "../schema/agents_schema.json"))) as f:
- schema = json.load(f)
-
-# define the initial value of the flow
-data = {
- "nodes": [
- Node(id="start-node", name="start", position=dict(x=0, y=0)),
- Node(id="initial-agent-node",
- name="agent",
- position=dict(x=200, y=0),
- data=dict(condition=['']))
- ],
- "edges": [Edge(source='start-node', target="initial-agent-node")],
-}
-
-
-def on_data_change(_flow):
- print(_flow)
-
-
-with gr.Blocks() as demo, ms.Application():
- flow = mgr.Flow(value=data, schema=schema, sync_on_data_change=True)
- flow.data_change(fn=on_data_change, inputs=[flow])
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/legacy/Flow/demos/component_options.py b/components/legacy/Flow/demos/component_options.py
deleted file mode 100644
index 79ccb9f0096791420ec47d2b5a95d87af812de34..0000000000000000000000000000000000000000
--- a/components/legacy/Flow/demos/component_options.py
+++ /dev/null
@@ -1,109 +0,0 @@
-import json
-import os
-
-import gradio as gr
-import modelscope_studio.components.base as ms
-import modelscope_studio.components.legacy as mgr
-from modelscope_studio.components.legacy.Flow import (BackgroundPropsDict,
- Edge, Node)
-
-with open((os.path.join(os.path.dirname(__file__),
- "../schema/agents_schema.json"))) as f:
- schema = json.load(f)
-
-# define the initial value of the flow
-data = {
- "nodes": [
- Node(id="start-node", name="start", position=dict(x=0, y=0)),
- Node(id="initial-agent-node",
- name="agent",
- position=dict(x=200, y=0),
- data=dict(condition=['']))
- ],
- "edges": [Edge(source='start-node', target="initial-agent-node")],
-}
-
-
-def on_data_change(_flow):
- print(_flow)
-
-
-flow_props = ["show_sidebar", "show_minimap", "show_controls"]
-
-
-def on_change(_flow_config, _bgc_variant, _bgc_color, _bgc_bg_color, _bgc_gap,
- _bgc_size, _bgc_offset, _bgc_line_width):
- new_props = {}
- new_background_props = {
- "variant": _bgc_variant,
- "bgColor": _bgc_bg_color,
- "color": _bgc_color,
- "gap": _bgc_gap,
- "size": _bgc_size,
- "offset": _bgc_offset,
- 'lineWidth': _bgc_line_width
- }
- for choice in flow_props:
- if choice in _flow_config:
- new_props[choice] = True
- else:
- new_props[choice] = False
- return gr.update(**new_props, background_props=new_background_props)
-
-
-with gr.Blocks() as demo, ms.Application():
- with gr.Accordion(label="Flow Options"):
- flow_config = gr.CheckboxGroup(
- container=False,
- value=["show_sidebar", "show_minimap", "show_controls"],
- choices=flow_props)
- with gr.Accordion(label="Background Props"):
- with gr.Row():
- with gr.Column():
- bgc_variant = gr.Radio(choices=["dots", "lines", "cross"],
- label="variant",
- value="dots")
- with gr.Column():
- bgc_color = gr.ColorPicker(label="color", value="")
- with gr.Column():
- bgc_bg_color = gr.ColorPicker(label="bgColor", value="")
- with gr.Column():
- bgc_gap = gr.Slider(label="gap", value=28)
- with gr.Column():
- bgc_size = gr.Slider(label="size",
- value=1,
- maximum=10,
- step=1)
- with gr.Column():
- bgc_offset = gr.Slider(label="offset",
- value=1,
- step=1,
- maximum=10)
- with gr.Column():
- bgc_line_width = gr.Slider(label="lineWidth",
- value=1,
- step=1,
- maximum=10)
-
- flow = mgr.Flow(value=data,
- schema=schema,
- show_controls=True,
- show_minimap=True,
- show_sidebar=True,
- sync_on_data_change=True,
- background_props=BackgroundPropsDict(variant='dots'))
- gr.on(triggers=[
- flow_config.change, bgc_variant.change, bgc_color.change,
- bgc_bg_color.change, bgc_gap.change, bgc_size.change,
- bgc_offset.change, bgc_line_width.change
- ],
- fn=on_change,
- inputs=[
- flow_config, bgc_variant, bgc_color, bgc_bg_color, bgc_gap,
- bgc_size, bgc_offset, bgc_line_width
- ],
- outputs=[flow])
- flow.data_change(fn=on_data_change, inputs=[flow])
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/legacy/Flow/demos/custom_node_type.py b/components/legacy/Flow/demos/custom_node_type.py
deleted file mode 100644
index d2b50b1e5e8e7336d0c2407b4db6133d82de6473..0000000000000000000000000000000000000000
--- a/components/legacy/Flow/demos/custom_node_type.py
+++ /dev/null
@@ -1,69 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.base as ms
-import modelscope_studio.components.legacy as mgr
-from modelscope_studio.components.legacy.Flow import (FlowSchemaDict, Node,
- NodeSchemaAttributeDict,
- NodeSchemaDict)
-
-
-def on_data_change(_flow):
- print(_flow)
-
-
-def on_custom(data: gr.EventData):
- print(data._data)
-
-
-custom_components = {
- "my-input": {
- "js":
- """
-(props, cc, { el, theme, onMount, onUpdate }) => {
- onMount(() => {
- el.innerHTML = ``
- const input = el.querySelector('input')
- input.style.color = theme === 'dark' ? 'white' : 'black'
- input.style.backgroundColor = theme === 'dark' ? 'black' : 'white'
- input.addEventListener('change', (e) => {
- cc.dispatch(e.target.value)
- })
- })
- // props update
- onUpdate(
- () => {
- const input = el.querySelector('input')
- input.setAttribute('value', props.value || '')
- },
- // By default, the callback will not be called when the component is being mounted. Set `callAfterMount` to true to enable it.
- { callAfterMount: true }
- )
-}
-"""
- }
-}
-
-schema = FlowSchemaDict(nodes=[
- NodeSchemaDict(name="my-input-node",
- title="MyInputNode",
- attrs=[NodeSchemaAttributeDict(name="a", type="my-input")])
-])
-
-data = {
- "nodes": [
- Node(name="my-input-node",
- position=dict(x=0, y=0),
- data=dict(a='Hello'))
- ]
-}
-
-with gr.Blocks() as demo, ms.Application():
- flow = mgr.Flow(value=data,
- schema=schema,
- custom_components=custom_components,
- sync_on_data_change=True)
- flow.data_change(fn=on_data_change, inputs=[flow])
- # called when custom component dispatch event
- flow.custom(fn=on_custom)
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/legacy/Flow/schema/agents_schema.json b/components/legacy/Flow/schema/agents_schema.json
deleted file mode 100644
index 3134b2dc35895f14c0f1ff11061db9a13836f0f7..0000000000000000000000000000000000000000
--- a/components/legacy/Flow/schema/agents_schema.json
+++ /dev/null
@@ -1,66 +0,0 @@
-{
- "$schema": "https://raw.githubusercontent.com/modelscope/modelscope-studio/main/frontend/Flow/schema.json",
- "nodes": [
- {
- "max": 1,
- "min": 1,
- "addable": false,
- "show_toolbar": false,
- "name": "start",
- "title": "Start",
- "ports": {
- "source": ["right"],
- "target": []
- }
- },
- {
- "icon": "https://img.alicdn.com/imgextra/i4/O1CN01fvt4it25rEZU4Gjso_!!6000000007579-2-tps-128-128.png",
- "name": "agent",
- "title": "Agent Node",
- "description": "Agent Flow Node",
- "ports": {
- "target": ["left"],
- "source": []
- },
- "attrs": [
- {
- "name": "prompt",
- "title": "Agent Prompt",
- "type": "textarea",
- "required": {
- "message": "Agent Prompt is required"
- }
- },
- {
- "name": "tool",
- "title": "Tools",
- "type": "select",
- "props": {
- "mode": "multiple",
- "options": [
- { "label": "Wanx Image Generation", "value": "image_gen" },
- { "label": "Code Interpreter", "value": "code_interpreter" },
- { "label": "Web Browsing", "value": "web_browser" }
- ]
- }
- },
- {
- "name": "condition",
- "title": "Jump Condition",
- "list": {
- "min": 1,
- "ports": {
- "source": ["right"]
- }
- },
- "accordion": false
- }
- ],
- "template": {
- "attrs": {
- "condition": [""]
- }
- }
- }
- ]
-}
diff --git a/components/legacy/Flow/schema/agents_schema.py b/components/legacy/Flow/schema/agents_schema.py
deleted file mode 100644
index d80f78483713a654899a9bcfe73ee836e8c2ff6a..0000000000000000000000000000000000000000
--- a/components/legacy/Flow/schema/agents_schema.py
+++ /dev/null
@@ -1,59 +0,0 @@
-import os
-
-from modelscope_studio.components.legacy.Flow import (
- FlowSchemaDict, NodeSchemaAttributeDict, NodeSchemaAttributeListDict,
- NodeSchemaAttributeRequiredDict, NodeSchemaDict, NodeSchemaPortsDict,
- NodeSchemaTemplateDict)
-
-
-def resolve_assets(relative_path):
- return os.path.join(os.path.dirname(__file__), "../../resources",
- relative_path)
-
-
-schema = FlowSchemaDict(nodes=[
- NodeSchemaDict(max=1,
- min=1,
- addable=False,
- show_toolbar=False,
- name="start",
- title="Start",
- ports=NodeSchemaPortsDict(source=['right'], target=[])),
- NodeSchemaDict(
- icon=resolve_assets('./bot.jpeg'),
- name="agent",
- title="Agent Node",
- description="Agent Flow Node",
- ports=NodeSchemaPortsDict(source=[], target=['left']),
- attrs=[
- NodeSchemaAttributeDict(name="prompt",
- title="Agent Prompt",
- type='textarea',
- required=NodeSchemaAttributeRequiredDict(
- message="Agent Prompt is required")),
- NodeSchemaAttributeDict(name="tool",
- title="Tools",
- type="select",
- props={
- "mode":
- "multiple",
- "options": [{
- "label": "Wanx Image Generation",
- "value": "image_gen"
- }, {
- "label": "Code Interpreter",
- "value": "code_interpreter"
- }, {
- "label": "Web Browsing",
- "value": "web_browser"
- }]
- }),
- NodeSchemaAttributeDict(
- name="condition",
- title="Jump Condition",
- list=NodeSchemaAttributeListDict(
- min=1, ports=NodeSchemaPortsDict(source=['right'])),
- accordion=False)
- ],
- template=NodeSchemaTemplateDict(attrs=dict(condition=[''])))
-])
diff --git a/components/legacy/Lifecycle/README-zh_CN.md b/components/legacy/Lifecycle/README-zh_CN.md
deleted file mode 100644
index 2a110cbdbbcd3934c63fd412764634c46b1925bd..0000000000000000000000000000000000000000
--- a/components/legacy/Lifecycle/README-zh_CN.md
+++ /dev/null
@@ -1,53 +0,0 @@
-# Lifecycle
-
-生命周期组件,用于获取当前用户的环境信息。
-
-- 获取当前用户的语言、页面主题、user agent 和屏幕状态。
-- 监听页面行为并触发相应事件(页面加载、尺寸变化、页面关闭等)。
-
-## 如何使用
-
-### 基本使用
-
-
-
-### 自动适配用户语言环境
-
-
-
-### 根据用户界面主题返回不同权重内容
-
-
-
-## API 及参数列表
-
-### value
-
-接口定义:
-
-```python
-class LifecycleScreenData(GradioModel):
- width: float
- height: float
- scrollX: float
- scrollY: float
-
-
-class LifecycleData(GradioModel):
- screen: LifecycleScreenData
- language: str
- theme: str
- userAgent: str
-```
-
-### props
-
-该组件不支持传入 props。
-
-### event listeners
-
-| 事件 | 描述 |
-| -------------------------------- | --------------------------------------------------------------------- |
-| `mgr.Lifecycle.mount(fn, ···)` | 用户页面加载时触发,EventData 为当前组件 value 的 dict 类型值。 |
-| `mgr.Lifecycle.unmount(fn, ···)` | 用户页面关闭时触发,EventData 为当前组件 value 的 dict 类型值。 |
-| `mgr.Lifecycle.resize(fn, ···)` | 自定义标签触发事件时触发,EventData 为当前组件 value 的 dict 类型值。 |
diff --git a/components/legacy/Lifecycle/README.md b/components/legacy/Lifecycle/README.md
deleted file mode 100644
index 66c646f9d311a6702078e4cb45cb147308e22a80..0000000000000000000000000000000000000000
--- a/components/legacy/Lifecycle/README.md
+++ /dev/null
@@ -1,53 +0,0 @@
-# Lifecycle
-
-A Lifecycle component for getting the current user's environment information.
-
-- Get the current user's language, page theme, user agent, and screen state.
-- Listen to page actions and trigger corresponding events (page loading, size changes, page closing, etc.).
-
-## How to Use
-
-### Basic Usage
-
-
-
-### Automatically Adapt to User Language Environment
-
-
-
-### Return Different Weighted Content Based on UI Theme
-
-
-
-## API and Parameter List
-
-### Value
-
-Interface definition:
-
-```python
-class LifecycleScreenData(GradioModel):
- width: float
- height: float
- scrollX: float
- scrollY: float
-
-
-class LifecycleData(GradioModel):
- screen: LifecycleScreenData
- language: str
- theme: str
- userAgent: str
-```
-
-### Props
-
-This component does not support passing in props.
-
-### Event Listeners
-
-| Event | Description |
-| -------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
-| `mgr.Lifecycle.mount(fn, ···)` | Triggered when the user's page loads. The EventData is a dictionary type value of the current component's value. |
-| `mgr.Lifecycle.unmount(fn, ···)` | Triggered when the user's page closes. The EventData is a dictionary type value of the current component's value. |
-| `mgr.Lifecycle.resize(fn, ···)` | Triggered when custom labels trigger events. The EventData is a dictionary type value of the current component's value. |
diff --git a/components/legacy/Lifecycle/app.py b/components/legacy/Lifecycle/app.py
deleted file mode 100644
index ea841f78832d9254426dc781674f7e39f7f7fd2f..0000000000000000000000000000000000000000
--- a/components/legacy/Lifecycle/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from components.legacy.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/legacy/Lifecycle/demos/basic.py b/components/legacy/Lifecycle/demos/basic.py
deleted file mode 100644
index dc35dd8a38fae9d9def1b8dfe1494117361fe93a..0000000000000000000000000000000000000000
--- a/components/legacy/Lifecycle/demos/basic.py
+++ /dev/null
@@ -1,28 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.base as ms
-import modelscope_studio.components.legacy as mgr
-
-
-def mount(e: gr.EventData):
- # current page state
- print("onMount", e._data)
-
-
-def resize(e: gr.EventData):
- print("onResize", e._data)
-
-
-def onUnmount(e: gr.EventData):
- print("onUnmount", e._data)
-
-
-with gr.Blocks() as demo, ms.Application():
- gr.Markdown("The Lifecycle component will not be rendered on the page.")
- lifecycle = mgr.Lifecycle()
- # listen to the page lifecycle
- lifecycle.mount(fn=mount)
- lifecycle.resize(fn=resize)
- lifecycle.unmount(fn=onUnmount)
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/legacy/Lifecycle/demos/language_adaptation.py b/components/legacy/Lifecycle/demos/language_adaptation.py
deleted file mode 100644
index c6f53551f373fbcd43bc9d09264dd11c07633370..0000000000000000000000000000000000000000
--- a/components/legacy/Lifecycle/demos/language_adaptation.py
+++ /dev/null
@@ -1,41 +0,0 @@
-import time
-
-import gradio as gr
-import modelscope_studio.components.base as ms
-import modelscope_studio.components.legacy as mgr
-
-messages = {
- 'en': {
- "hello": "Hello"
- },
- 'en-US': {
- "hello": "Hello"
- },
- 'zh-CN': {
- "hello": "你好"
- }
-}
-
-default_lang = "en"
-
-
-def mount(_lifecycle, _state):
- lang = _lifecycle.language
- if (lang in messages):
- _state["current_lang"] = lang
- yield 'Switch Language...', _state
- time.sleep(2)
- yield messages[lang]["hello"], _state
-
-
-with gr.Blocks() as demo, ms.Application():
- lifecycle = mgr.Lifecycle()
- state = gr.State({"current_lang": default_lang})
- markdown = gr.Markdown(value=messages[default_lang]["hello"])
-
- lifecycle.mount(fn=mount,
- inputs=[lifecycle, state],
- outputs=[markdown, state])
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/legacy/Lifecycle/demos/theme_adaptation.py b/components/legacy/Lifecycle/demos/theme_adaptation.py
deleted file mode 100644
index e1b87b6b72513e390a64f438a495086eff7c7960..0000000000000000000000000000000000000000
--- a/components/legacy/Lifecycle/demos/theme_adaptation.py
+++ /dev/null
@@ -1,28 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.base as ms
-import modelscope_studio.components.legacy as mgr
-
-
-def mount(_lifecycle, _state):
- _state["theme"] = _lifecycle.theme
- yield _state
-
-
-def fn(_state):
- theme = _state["theme"]
- color = '000/fff' if theme == 'dark' else 'fff/000'
- yield gr.update(
- value=f"https://dummyimage.com/200x100/{color}.png&text={theme}")
-
-
-with gr.Blocks() as demo, ms.Application():
- lifecycle = mgr.Lifecycle()
- state = gr.State({"theme": "light"})
- btn = gr.Button()
- image = gr.Image()
-
- lifecycle.mount(fn=mount, inputs=[lifecycle, state], outputs=[state])
- btn.click(fn=fn, inputs=[state], outputs=[image])
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/legacy/Markdown/README.md b/components/legacy/Markdown/README.md
deleted file mode 100644
index 9a705158481c04a05043a751f081e737a64f9bea..0000000000000000000000000000000000000000
--- a/components/legacy/Markdown/README.md
+++ /dev/null
@@ -1,92 +0,0 @@
-# Markdown
-
-Upgraded gradio Markdown.
-
-- Supports output of multimodal content (audio, video, image, text)
-- Built-in tags (chart, select-box, accordion)
-- Supports custom rendering components and interaction with Python events
-
-## How to Use
-
-### Basic Usage
-
-
-
-### Multimodal & Support for Local File Display
-
-
-
-### Support for Accordion Content Display
-
-Include the `accordion` tag in the returned content. For more usage details, see accordion
-
-
-### Support for User Selection Interaction
-
-Include the `select-box` tag in the returned content. For more usage details, see select-box
-
-
-### Support for Chart Display
-
-Include the `chart` tag in the returned content. For more usage details, see chart
-
-
-### Custom Tags (Advanced Usage, Requires Frontend Knowledge)
-
-
-
-#### Import JS
-
-
-The template can only perform simple variable replacements. If you want to introduce more custom behaviors, such as conditional judgments, loop rendering, etc., please use js to control the element for processing. Here is a simple example:
-
-
-custom_select.js
-
-```js
-
-```
-
-
-
-
-#### Interaction with Python
-
-In js, you can use `cc.dispatch` to trigger the `custom` event listened to on the Python side. Taking the previous custom_select.js as an example, when we call `cc.dispatch(options[i])` on the frontend, a notification will be sent to the Python side simultaneously.
-
-
-## API and Parameter List
-
-The following APIs are additional extended parameters beyond the original gradio Markdown.
-
-### props
-
-| Attribute | Type | Default Value | Description |
-| ----------------------------- | ------------------------------------------------------------------- | ------------- | ---------------------------------------------------------------------------------------------------------- |
-| enable_base64 | bool | False | Whether to support rendering content as base64, since rendering base64 is unsafe, the default is False. |
-| preview | bool | True | Whether to enable image preview functionality. |
-| enable_latex | bool | True | Whether to enable LaTeX rendering. |
-| latex_single_dollar_delimiter | bool | True | Whe ther to enable single dollar delimiter `$` for LaTeX rendering. |
-| custom_components | Dict[str, CustomComponentDict] CustomComponentDict definition below | None | Supports user-defined custom tags and controls tag rendering styles and triggers Python events through js. |
-| |
-
-**CustomComponent definition is as follows:**
-
-```python
-class CustomComponentDict(TypedDict):
- props: Optional[List[str]]
- template: Optional[str]
- js: Optional[str]
-```
-
-### Built-in Custom Tags
-
-- select-box
-- accordion
-- chart
-
-### Event Listeners
-
-| Event | Description |
-| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
-| `mgr.Markdown.custom(fn, ···)` | Triggered when a custom tag event occurs. EventData is: - tag: The current tag that triggered the event. - tag_index: The index of the current triggered tag. - value: The custom value passed in. |
diff --git a/components/legacy/Markdown/custom_tags/chart-zh_CN.md b/components/legacy/Markdown/custom_tags/chart-zh_CN.md
deleted file mode 100644
index caca68a9e3ef4b4d7a83320cfef55fb48968ed9c..0000000000000000000000000000000000000000
--- a/components/legacy/Markdown/custom_tags/chart-zh_CN.md
+++ /dev/null
@@ -1,17 +0,0 @@
-# chart
-
-在 markdown 文本中添加图表。
-
-## 如何使用
-
-### 基本使用
-
-
-
-## API 及参数列表
-
-### props
-
-| 属性 | 类型 | 默认值 | 描述 |
-| ------- | ------ | ------ | ----------------------------------------------------------------------------------------- |
-| options | object | | `echarts`的 options 配置,详见:[echarts docs](https://echarts.apache.org/en/option.html) |
diff --git a/components/legacy/Markdown/custom_tags/chart.md b/components/legacy/Markdown/custom_tags/chart.md
deleted file mode 100644
index c5fa26a2d9dadf4be5c48cdeafb828cb6daa3f02..0000000000000000000000000000000000000000
--- a/components/legacy/Markdown/custom_tags/chart.md
+++ /dev/null
@@ -1,17 +0,0 @@
-# chart
-
-Add a chart to markdown text.
-
-## How to Use
-
-### Basic Usage
-
-
-
-## API and Parameter List
-
-### props
-
-| Attribute | Type | Default Value | Description |
-| --------- | ------ | ------------- | --------------------------------------------------------------------------------- |
-| options | object | | `echarts` options, see: [echarts docs](https://echarts.apache.org/en/option.html) |
diff --git a/components/legacy/Markdown/demos/accordion.py b/components/legacy/Markdown/demos/accordion.py
deleted file mode 100644
index 6bc3615a2e17fe7866ac12e7310964da458dbcbe..0000000000000000000000000000000000000000
--- a/components/legacy/Markdown/demos/accordion.py
+++ /dev/null
@@ -1,28 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.base as ms
-import modelscope_studio.components.legacy as mgr
-
-with gr.Blocks() as demo, ms.Application():
- mgr.Markdown("""
-
-
-```json
-{"text": "glorious weather", "resolution": "1024*1024"}
-```
-
-
-
-Use `::accordion-title` to support markdown:
-
-
-
-::accordion-title[Using `tool`]
-
-```json
-{"text": "glorious weather", "resolution": "1024*1024"}
-```
-
-""")
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/legacy/Markdown/demos/chart.py b/components/legacy/Markdown/demos/chart.py
deleted file mode 100644
index e4c492b0336ec3e52f913863a7b4eca70f5abae0..0000000000000000000000000000000000000000
--- a/components/legacy/Markdown/demos/chart.py
+++ /dev/null
@@ -1,31 +0,0 @@
-import json
-
-import gradio as gr
-import modelscope_studio.components.base as ms
-import modelscope_studio.components.legacy as mgr
-
-# echarts options, see: https://echarts.apache.org/en/index.html
-option1 = {
- "xAxis": {
- "type": 'category',
- "data": ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
- },
- "yAxis": {
- "type": 'value',
- },
- "series": [
- {
- "data": [150, 230, 224, 218, 135, 147, 260],
- "type": 'line',
- },
- ],
-}
-
-with gr.Blocks() as demo, ms.Application():
- mgr.Markdown(f"""
-Chart:
-
-""")
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/legacy/Markdown/demos/custom_tags/accordion/accordion-title.py b/components/legacy/Markdown/demos/custom_tags/accordion/accordion-title.py
deleted file mode 100644
index 9057415f7e4a3a6d89a6df18d4c61048b571cbaa..0000000000000000000000000000000000000000
--- a/components/legacy/Markdown/demos/custom_tags/accordion/accordion-title.py
+++ /dev/null
@@ -1,19 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.base as ms
-import modelscope_studio.components.legacy as mgr
-
-with gr.Blocks() as demo, ms.Application():
- mgr.Markdown("""
-
-
-::accordion-title[Using `tool`]
-
-```json
-{"text": "glorious weather", "resolution": "1024*1024"}
-```
-
-
-""")
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/legacy/Markdown/demos/custom_tags/accordion/basic.py b/components/legacy/Markdown/demos/custom_tags/accordion/basic.py
deleted file mode 100644
index 4020df36938a44f3cba2d983290fcad001600755..0000000000000000000000000000000000000000
--- a/components/legacy/Markdown/demos/custom_tags/accordion/basic.py
+++ /dev/null
@@ -1,17 +0,0 @@
-import gradio as gr
-import modelscope_studio.components.base as ms
-import modelscope_studio.components.legacy as mgr
-
-with gr.Blocks() as demo, ms.Application():
- mgr.Markdown("""
-
-
-```json
-{"text": "glorious weather", "resolution": "1024*1024"}
-```
-
-
-""")
-
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/legacy/Markdown/demos/custom_tags/chart/basic.py b/components/legacy/Markdown/demos/custom_tags/chart/basic.py
deleted file mode 100644
index ad3ac880eeb8b2cec77c5680dbd1745f8e5e61a4..0000000000000000000000000000000000000000
--- a/components/legacy/Markdown/demos/custom_tags/chart/basic.py
+++ /dev/null
@@ -1,84 +0,0 @@
-import json
-
-import gradio as gr
-import modelscope_studio.components.base as ms
-import modelscope_studio.components.legacy as mgr
-
-# echarts options, see: https://echarts.apache.org/en/index.html
-option1 = {
- "xAxis": {
- "type": 'category',
- "data": ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
- },
- "yAxis": {
- "type": 'value',
- },
- "series": [
- {
- "data": [150, 230, 224, 218, 135, 147, 260],
- "type": 'line',
- },
- ],
-}
-
-option2 = {
- "tooltip": {
- "trigger": 'item'
- },
- "legend": {
- "top": '5%',
- "left": 'center'
- },
- "series": [{
- "name":
- 'Access From',
- "type":
- 'pie',
- "radius": ['40%', '70%'],
- "avoidLabelOverlap":
- False,
- "itemStyle": {
- "borderRadius": 10,
- "borderColor": '#fff',
- "borderWidth": 2
- },
- "label": {
- "show": False,
- "position": 'center'
- },
- "emphasis": {
- "label": {
- "show": True,
- "fontSize": 40,
- "fontWeight": 'bold'
- }
- },
- "labelLine": {
- "show": False
- },
- "data": [{
- "value": 1048,
- "name": 'Search Engine'
- }, {
- "value": 735,
- "name": 'Direct'
- }, {
- "value": 580,
- "name": 'Email'
- }, {
- "value": 484,
- "name": 'Union Ads'
- }, {
- "value": 300,
- "name": 'Video Ads'
- }]
- }]
-}
-
-with gr.Blocks() as demo, ms.Application():
- chatbot = mgr.Markdown(f"""
-
-
-""")
-if __name__ == "__main__":
- demo.queue().launch()
diff --git a/components/legacy/MultimodalInput/app.py b/components/legacy/MultimodalInput/app.py
deleted file mode 100644
index ea841f78832d9254426dc781674f7e39f7f7fd2f..0000000000000000000000000000000000000000
--- a/components/legacy/MultimodalInput/app.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from components.legacy.Docs import Docs
-
-docs = Docs(__file__)
-
-if __name__ == "__main__":
- docs.render().queue().launch()
diff --git a/components/legacy/README-zh_CN.md b/components/legacy/README-zh_CN.md
deleted file mode 100644
index 578a17393bbd2e735c0dd12d6c94894ea8b15aeb..0000000000000000000000000000000000000000
--- a/components/legacy/README-zh_CN.md
+++ /dev/null
@@ -1,33 +0,0 @@
-