Skip to content

Commit f9f2cae

Browse files
committed
fix: cloned props
1 parent 2b6ba3d commit f9f2cae

File tree

24 files changed

+196
-174
lines changed

24 files changed

+196
-174
lines changed

.changeset/pre.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,5 @@
1111
"@modelscope-studio/base": "1.6.1",
1212
"@modelscope-studio/pro": "1.6.1"
1313
},
14-
"changesets": [
15-
"eleven-aliens-sell"
16-
]
14+
"changesets": ["eleven-aliens-sell"]
1715
}

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,4 +445,4 @@
445445
### Features
446446

447447
- [#16](https://github.com/modelscope/modelscope-studio/pull/16) [`d1829d3`](https://github.com/modelscope/modelscope-studio/commit/d1829d34dd0bce8834d2e257b612d79705e57d6d) - update the timing of onMount call and new onUpdate lifecycle of custom component. Thanks [@Col0ring](https://github.com/Col0ring)!
448-
- [#16](https://github.com/modelscope/modelscope-studio/pull/16) [`96e1682`](https://github.com/modelscope/modelscope-studio/commit/96e1682b7cb63907aafba06afb820f55d7df8ff0) - add Flow component. Thanks [@Col0ring](https://github.com/Col0ring)!
448+
- [#16](https://github.com/modelscope/modelscope-studio/pull/16) [`96e1682`](https://github.com/modelscope/modelscope-studio/commit/96e1682b7cb63907aafba06afb820f55d7df8ff0) - add Flow component. Thanks [@Col0ring](https://github.com/Col0ring)!

backend/modelscope_studio/components/antdx/actions/action_item/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class AntdXActionsActionItem(ModelScopeLayoutComponent):
2121
]
2222

2323
# Supported slots
24-
SLOTS = ['label', 'icon', 'actionRender']
24+
SLOTS = ['label', 'icon', 'actionRender', "subItems"]
2525

2626
def __init__(
2727
self,

backend/modelscope_studio/components/pro/multimodal_input/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,7 @@ class ModelScopeProMultimodalInput(ModelScopeDataLayoutComponent):
139139
# supported slots
140140
SLOTS = [
141141
'suffix', 'header', 'prefix', 'footer', 'skill.title',
142-
'skill.toolTip.title'
143-
'skill.closable.closeIcon'
142+
'skill.toolTip.title', 'skill.closable.closeIcon'
144143
]
145144

146145
def __init__(

config/changelog/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,4 +276,4 @@ No significant changes to this package were made in this release.
276276

277277
## 0.2.0
278278

279-
No significant changes to this package were made in this release.
279+
No significant changes to this package were made in this release.

config/lint-config/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,4 +276,4 @@ No significant changes to this package were made in this release.
276276

277277
## 0.2.0
278278

279-
No significant changes to this package were made in this release.
279+
No significant changes to this package were made in this release.

docs/components/antdx/actions/demos/basic.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ def on_delete():
2222
with ms.Slot("icon"):
2323
antd.Icon("RedoOutlined")
2424
with antdx.Actions.ActionItem(key="copy", label="Copy"):
25-
with ms.Slot("icon"):
26-
antd.Icon("CopyOutlined")
25+
with ms.Slot("actionRender"):
26+
antdx.Actions.Copy(text="Copy Text")
2727
antd.Divider("More Menu ActionItems")
2828
with antdx.Actions() as actions2:
2929
with antdx.Actions.ActionItem(key="retry", label="Retry"):
@@ -33,24 +33,24 @@ def on_delete():
3333
with ms.Slot("icon"):
3434
antd.Icon("CopyOutlined")
3535
with antdx.Actions.ActionItem(key="more"):
36-
with antdx.Actions.ActionItem(key="share", label="Share"):
37-
with ms.Slot("icon"):
38-
antd.Icon("ShareAltOutlined")
39-
antdx.Actions.ActionItem(key="qq", label="QQ")
40-
antdx.Actions.ActionItem(key="wechat", label="WeChat")
41-
antdx.Actions.ActionItem(key="import", label="Import")
42-
with antdx.Actions.ActionItem(
43-
key="delete", label="Delete",
44-
danger=True) as actions_delete_ActionItem:
45-
with ms.Slot("icon"):
46-
antd.Icon("DeleteOutlined")
36+
with ms.Slot("subItems"):
37+
with antdx.Actions.ActionItem(key="share",
38+
label="Share"):
39+
with ms.Slot("icon"):
40+
antd.Icon("ShareAltOutlined")
41+
antdx.Actions.ActionItem(key="import", label="Import")
42+
with antdx.Actions.ActionItem(
43+
key="delete", label="Delete",
44+
danger=True) as actions_delete_item:
45+
with ms.Slot("icon"):
46+
antd.Icon("DeleteOutlined")
4747
with antdx.Actions.ActionItem(key="clear", label="Clear"):
4848
with ms.Slot("icon"):
4949
antd.Icon("ClearOutlined")
5050

5151
actions.click(fn=on_click)
5252
actions2.click(fn=on_click)
53-
actions_delete_ActionItem.ActionItem_click(fn=on_delete)
53+
actions_delete_item.item_click(fn=on_delete)
5454

5555
if __name__ == "__main__":
5656
demo.queue().launch()

docs/components/pro/chatbot/README-zh_CN.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ class ChatbotPromptsConfig(GradioModel):
107107
# Ant Design X welcome props: https://x.ant.design/components/welcome
108108
class ChatbotWelcomeConfig(GradioModel):
109109
variant: Optional[Literal['borderless', 'filled']] = 'borderless'
110-
icon: Optional[Union[str, Path]] = None
110+
icon: Optional[Union[str, Path, dict]] = None
111111
title: Optional[str] = None
112112
description: Optional[str] = None
113113
extra: Optional[str] = None
@@ -277,6 +277,8 @@ class ChatbotDataFileContentOptions(GradioModel):
277277
gap: Optional[Union[Literal["small", "middle", "large"], str, int,
278278
float]] = "small"
279279
image_props: Optional[dict] = None
280+
video_props: Optional[dict] = None
281+
audio_props: Optional[dict] = None
280282

281283

282284
# Ant Design X prompts props: https://x.ant.design/components/prompts
@@ -318,7 +320,8 @@ class ChatbotDataMessageContent(GradioModel):
318320

319321

320322
class ChatbotDataMessage(ChatbotBotConfig):
321-
role: Union[Literal['user', 'assistant', 'system'], str] = None
323+
role: Union[Literal['user', 'assistant', 'system', 'divider'], str] = None
324+
divider_props: Optional[dict] = None
322325
key: Optional[Union[str, int, float]] = None
323326
# If status is 'pending', the message will not render the footer area (including 'actions' and 'footer').
324327
status: Optional[Literal['pending', 'done']] = None

docs/components/pro/chatbot/README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class ChatbotPromptsConfig(GradioModel):
106106
# Ant Design X welcome props: https://x.ant.design/components/welcome
107107
class ChatbotWelcomeConfig(GradioModel):
108108
variant: Optional[Literal['borderless', 'filled']] = 'borderless'
109-
icon: Optional[Union[str, Path]] = None
109+
icon: Optional[Union[str, Path, dict]] = None
110110
title: Optional[str] = None
111111
description: Optional[str] = None
112112
extra: Optional[str] = None
@@ -276,6 +276,8 @@ class ChatbotDataFileContentOptions(GradioModel):
276276
gap: Optional[Union[Literal["small", "middle", "large"], str, int,
277277
float]] = "small"
278278
image_props: Optional[dict] = None
279+
video_props: Optional[dict] = None
280+
audio_props: Optional[dict] = None
279281

280282

281283
# Ant Design X prompts props: https://x.ant.design/components/prompts
@@ -317,7 +319,8 @@ class ChatbotDataMessageContent(GradioModel):
317319

318320

319321
class ChatbotDataMessage(ChatbotBotConfig):
320-
role: Union[Literal['user', 'assistant', 'system'], str] = None
322+
role: Union[Literal['user', 'assistant', 'system', 'divider'], str] = None
323+
divider_props: Optional[dict] = None
321324
key: Optional[Union[str, int, float]] = None
322325
# If status is 'pending', the message will not render the footer area (including 'actions' and 'footer').
323326
status: Optional[Literal['pending', 'done']] = None

docs/components/pro/multimodal_input/README-zh_CN.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,16 @@
3939
| placeholder | `str \| None` | None | 输入框的提示信息。 |
4040
| disabled | `bool \| None` | None | 是否禁用。 |
4141
| upload_config | `MultimodalInputUploadConfig \| dict \| None` | None | 文件上传配置。 |
42+
| slot_config | `dict \| None` | None | 词槽配置,配置后输入框将变为词槽模式,支持结构化输入,此模式 value 配置将无效。 |
43+
| skill | `dict \| None` | None | 技能配置,输入框将变为词槽模式,支持结构化输入,此模式 value 配置将无效。 |
4244

4345
### 插槽
4446

4547
```python
46-
SLOTS=['actions', "prefix", 'footer', 'header']
48+
SLOTS = [
49+
'suffix', 'header', 'prefix', 'footer', 'skill.title',
50+
'skill.toolTip.title', 'skill.closable.closeIcon'
51+
]
4752
```
4853

4954
### 类型
@@ -110,5 +115,4 @@ class MultimodalInputUploadConfig(GradioModel):
110115
class MultimodalInputValue(GradioModel):
111116
files: Optional[ListFiles] = None
112117
text: Optional[str] = None
113-
114118
```

0 commit comments

Comments
 (0)