Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fancy-swans-help.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'modelscope_studio': patch
---

feat: support `read_only` property for `Input`
13 changes: 13 additions & 0 deletions .changeset/gentle-rocks-tap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
'@modelscope-studio/legacy-multimodal-input': patch
'@modelscope-studio/legacy-compiled': patch
'@modelscope-studio/lint-config': patch
'@modelscope-studio/changelog': patch
'@modelscope-studio/antdx': patch
'@modelscope-studio/antd': patch
'@modelscope-studio/pro': patch
'@modelscope-studio/frontend': patch
'modelscope_studio': patch
---

chore: upgrade to antd 5.27.0, antdx 1.6.0
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,8 @@
},
"[css]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
},
"python-envs.defaultEnvManager": "ms-python.python:conda",
"python-envs.defaultPackageManager": "ms-python.python:conda",
"python-envs.pythonProjects": []
}
11 changes: 10 additions & 1 deletion backend/modelscope_studio/components/antd/card/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,21 @@ class AntdCard(ModelScopeLayoutComponent):

# supported slots
SLOTS = [
"actions",
'actions',
'cover',
'extra',
'tabBarExtraContent',
'tabBarExtraContent.left',
'tabBarExtraContent.right',
'title',
'tabList',
'tabProps.addIcon',
'tabProps.removeIcon',
'tabProps.renderTabBar',
'tabProps.tabBarExtraContent',
'tabProps.tabBarExtraContent.left',
'tabProps.tabBarExtraContent.right',
'tabProps.more.icon',
]

def __exit__(self, *args, **kwargs):
Expand Down
2 changes: 2 additions & 0 deletions backend/modelscope_studio/components/antd/input/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def __init__(
class_names: dict | None = None,
count: dict | None = None,
default_value: str | None = None,
read_only: bool | None = None,
disabled: bool | None = None,
max_length: int | None = None,
prefix: str | None = None,
Expand Down Expand Up @@ -88,6 +89,7 @@ def __init__(
self.class_names = class_names
self.count = count
self.default_value = default_value
self.read_only = read_only
self.disabled = disabled
self.max_length = max_length
self.prefix = prefix
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def __init__(
*,
default_value: str | None = None,
disabled: bool | None = None,
read_only: bool | None = None,
formatter: str | None = None,
mask: str | bool | None = None,
separator: str | None = None,
Expand Down Expand Up @@ -62,6 +63,7 @@ def __init__(
self.default_value = default_value
self.separator = separator
self.disabled = disabled
self.read_only = read_only
self.formatter = formatter
self.mask = mask
self.length = length
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def __init__(
class_names: dict | None = None,
count: dict | None = None,
default_value: str | None = None,
read_only: bool | None = None,
disabled: bool | None = None,
max_length: int | None = None,
prefix: str | None = None,
Expand Down Expand Up @@ -85,6 +86,7 @@ def __init__(
self.class_names = class_names
self.count = count
self.default_value = default_value
self.read_only = read_only
self.disabled = disabled
self.max_length = max_length
self.prefix = prefix
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def __init__(
class_names: dict | None = None,
count: dict | None = None,
default_value: str | None = None,
read_only: bool | None = None,
disabled: bool | None = None,
max_length: int | None = None,
prefix: str | None = None,
Expand Down Expand Up @@ -85,6 +86,7 @@ def __init__(
self.class_names = class_names
self.count = count
self.default_value = default_value
self.read_only = read_only
self.disabled = disabled
self.max_length = max_length
self.prefix = prefix
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def __init__(
class_names: dict | None = None,
count: dict | None = None,
default_value: str | None = None,
read_only: bool | None = None,
disabled: bool | None = None,
max_length: int | None = None,
show_count: bool | dict = None,
Expand Down Expand Up @@ -72,6 +73,7 @@ def __init__(
self.count = count
self.default_value = default_value
self.disabled = disabled
self.read_only = read_only
self.max_length = max_length
self.show_count = show_count
self.size = size
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def __init__(
status: Literal['success', 'exception', 'normal', 'active']
| None = None,
rounding: str | None = None,
stroke_color: str | None = None,
stroke_color: str | list[str] | dict | None = None,
stroke_linecap: Literal['round', 'butt', 'square']
| None = None,
success: dict | None = None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def __init__(
column_width: int | float | str | None = None,
fixed: bool | None = None,
get_checkbox_props: str | None = None,
get_title_checkbox_props: str | None = None,
hide_select_all: bool | None = None,
preserve_selected_rows_keys: bool | None = None,
render_cell: str | None = None,
Expand Down Expand Up @@ -83,6 +84,7 @@ def __init__(
self.column_width = column_width
self.fixed = fixed
self.get_checkbox_props = get_checkbox_props
self.get_title_checkbox_props = get_title_checkbox_props
self.hide_select_all = hide_select_all
self.preserve_selected_rows_keys = preserve_selected_rows_keys
self.render_cell = render_cell
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,16 @@ class AntdTagCheckableTag(ModelScopeDataLayoutComponent):
bind_click_event=True))
]

# supported slots
SLOTS = ["icon"]

def __init__(
self,
label: str | None = None,
value: bool | None = None,
props: dict | None = None,
*,
icon: str | None = None,
root_class_name: str | None = None,
as_item: str | None = None,
_internal: None = None,
Expand All @@ -48,6 +52,7 @@ def __init__(
**kwargs)
self.props = props
self.label = label
self.icon = icon
self.root_class_name = root_class_name

FRONTEND_DIR = resolve_frontend_dir("tag", 'checkable-tag')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from __future__ import annotations

from typing import Literal, Union

from gradio.events import EventListener

from .....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir
Expand All @@ -17,18 +19,20 @@ class AntdXAttachmentsFileCard(ModelScopeLayoutComponent):

# supported slots
SLOTS = [
'imageProps.placeholder',
'imageProps.preview.mask',
'imageProps.preview.closeIcon',
'imageProps.preview.toolbarRender',
'imageProps.preview.imageRender',
'imageProps.placeholder', 'imageProps.preview.mask',
'imageProps.preview.closeIcon', 'imageProps.preview.toolbarRender',
'imageProps.preview.imageRender', 'icon'
]

def __init__(
self,
props: dict | None = None,
*,
image_props: dict | None = None,
icon: Union[Literal['default', 'excel', 'image', 'markdown', 'pdf',
'ppt', 'word', 'zip', 'video', 'audio'], str]
| None = None,
type: Literal['image', 'file'] | None = None,
item: dict | str | None = None,
as_item: str | None = None,
_internal: None = None,
Expand All @@ -47,6 +51,8 @@ def __init__(
elem_style=elem_style,
**kwargs)
self.props = props
self.icon = icon
self.type = type
self.image_props = image_props
if isinstance(item, str):
self.item = self.serve_static_file(item)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ def resolve_frontend_dir(component: str,
dir = dir + f"/{c}"
return f"{'../' * len(sub_component)}../../../../../frontend/{type}/{component}{dir}"

if (sub_component):
if sub_component:
return f"../../../../../../frontend/{type}/{component}/{sub_component}"
return f"../../../../../frontend/{type}/{component}"
2 changes: 1 addition & 1 deletion config/changelog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
},
"devDependencies": {
"@changesets/types": "^6.1.0",
"@types/node": "^24.1.0",
"@types/node": "^24.2.1",
"tsup": "^8.5.0"
}
}
16 changes: 8 additions & 8 deletions config/lint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
}
},
"dependencies": {
"@eslint/compat": "^1.3.1",
"@eslint/js": "^9.32.0",
"@typescript-eslint/parser": "^8.38.0",
"@eslint/compat": "^1.3.2",
"@eslint/js": "^9.33.0",
"@typescript-eslint/parser": "^8.39.1",
"eslint-config-prettier": "^10.1.8",
"eslint-import-resolver-typescript": "^4.4.4",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-prettier": "5.5.3",
"eslint-plugin-prettier": "5.5.4",
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-hooks": "^5.2.0",
"eslint-plugin-react-refresh": "^0.4.20",
Expand All @@ -32,14 +32,14 @@
"globals": "^16.3.0",
"postcss": "^8.5.6",
"postcss-less": "^6.0.0",
"stylelint-config-ali": "^2.1.2",
"stylelint-config-ali": "^2.2.0",
"stylelint-config-rational-order": "^0.1.2",
"stylelint-config-standard": "^38.0.0",
"stylelint-config-standard": "^39.0.0",
"stylelint-declaration-block-no-ignored-properties": "^2.8.0",
"stylelint-order": "^7.0.0",
"stylelint-prettier": "^5.0.3",
"svelte-eslint-parser": "^1.3.0",
"typescript-eslint": "^8.38.0"
"svelte-eslint-parser": "^1.3.1",
"typescript-eslint": "^8.39.1"
},
"devDependencies": {
"@types/eslint": "^9.6.1",
Expand Down
Loading