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
6 changes: 6 additions & 0 deletions .changeset/brave-otters-listen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@modelscope-studio/antd': patch
'modelscope_studio': patch
---

feat: add `antd.BorderBeam` and `antd.Listy` components
10 changes: 10 additions & 0 deletions .changeset/bright-crabs-clap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'@modelscope-studio/antdx': patch
'modelscope_studio': patch
---

feat: sync antdx APIs from 2.7.0 to 2.9.0

- `Folder`: new `context_menu` (items or JS function string) and `right_click` event
- `Folder.TreeNode`: new `context_menu` (items or `False` to disable per-node)
- `Think` and `ThoughtChain.ThoughtChainItem`: new `destroy_on_hidden`
6 changes: 6 additions & 0 deletions .changeset/clean-brushes-drum.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@modelscope-studio/frontend': patch
'modelscope_studio': patch
---

fix: refit the frontend vite plugin for Vite 8 + rolldown
15 changes: 15 additions & 0 deletions .changeset/fresh-shoes-jog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
'@modelscope-studio/antd': patch
'modelscope_studio': patch
---

feat: sync antd APIs from 6.4.2 to 6.6.0

- New `clear` event on `DatePicker`, `DatePicker.RangePicker`, `TimePicker`, `TimePicker.RangePicker`
- New props: `Modal.scroll_lock` / `Modal.Static.scroll_lock`, `Steps.max_count`, `FloatButton.BackTop.show_progress`, `Mentions.popup_render`
- New slots: `Tabs` `more.popupRender`, `Pagination` / `Table` `components.sizeChanger`
- `Slider.disabled` accepts a list, `Watermark.content` accepts per-line font styles, `Select.token_separators` accepts a JS function string
- `Dropdown` / `Dropdown.Button` `placement` completed to the full set
- `ConfigProvider` new locale `sq_AL`
- Add `Input.Password.visibility_toggle` (with `visiable_toggle` kept as a compatibility alias)
- Fix a missing comma in `Table` `SLOTS` that dropped one slot
6 changes: 6 additions & 0 deletions .changeset/lucky-taxis-serve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@modelscope-studio/frontend': patch
'modelscope_studio': patch
---

feat: vendor `@gradio/preview` to `patches/gradio-preview` to support both Gradio bundle generations, and fix the `svelte-i18n` 404 and broken `gradio cc dev` boot along the way
11 changes: 11 additions & 0 deletions .changeset/silly-doors-bathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
'@modelscope-studio/antd': patch
'@modelscope-studio/antdx': patch
'@modelscope-studio/base': patch
'@modelscope-studio/pro': patch
'@modelscope-studio/frontend': patch
'@modelscope-studio/lint-config': patch
'modelscope_studio': patch
---

chore: upgrade antd to 6.6.0, antdx to 2.9.0 and refresh the build stack (Vite 8 + rolldown, React 19.2.8, svelte 5.56.8, Babel 8, monaco-editor 0.56, TypeScript 6, Gradio 6.8.0)
5 changes: 5 additions & 0 deletions .changeset/tidy-donkeys-thank.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@modelscope-studio/changelog': patch
---

fix(changelog): migrate to the `@changesets/get-github-info` v1 API (`getCommitInfo` / `getPullRequestInfo`)
1 change: 1 addition & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[flake8]
exclude =
node_modules/
patches/
max-line-length = 9999
avoid-escape = no
ignore =
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ __pycache__/
__tmp/*
*.pyi
templates

/gradio
# common

!.*ignore
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,4 @@ pnpm-lock.yaml

frontend/compiled/build-assets
templates
patches
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ ModelScopeLayoutComponent <|-- AntdTimeline

**Section sources**

- [backend/modelscope_studio/components/antd/segmented/__init__.py]
- [backend/modelscope_studio/components/antd/segmented/**init**.py]

### Statistic

Expand All @@ -441,7 +441,7 @@ ModelScopeLayoutComponent <|-- AntdTimeline

**Section sources**

- [backend/modelscope_studio/components/antd/statistic/__init__.py]
- [backend/modelscope_studio/components/antd/statistic/**init**.py]

### Table

Expand All @@ -454,7 +454,7 @@ ModelScopeLayoutComponent <|-- AntdTimeline

**Section sources**

- [backend/modelscope_studio/components/antd/table/__init__.py]
- [backend/modelscope_studio/components/antd/table/**init**.py]

### Tabs

Expand All @@ -467,7 +467,7 @@ ModelScopeLayoutComponent <|-- AntdTimeline

**Section sources**

- [backend/modelscope_studio/components/antd/tabs/__init__.py]
- [backend/modelscope_studio/components/antd/tabs/**init**.py]

### Tag

Expand Down Expand Up @@ -513,7 +513,7 @@ ModelScopeLayoutComponent <|-- AntdTimeline

**Section sources**

- [backend/modelscope_studio/components/antd/tooltip/__init__.py]
- [backend/modelscope_studio/components/antd/tooltip/**init**.py]

### Tour

Expand All @@ -526,7 +526,7 @@ ModelScopeLayoutComponent <|-- AntdTimeline

**Section sources**

- [backend/modelscope_studio/components/antd/tour/__init__.py]
- [backend/modelscope_studio/components/antd/tour/**init**.py]

### Tree

Expand All @@ -539,7 +539,7 @@ ModelScopeLayoutComponent <|-- AntdTimeline

**Section sources**

- [backend/modelscope_studio/components/antd/tree/__init__.py]
- [backend/modelscope_studio/components/antd/tree/**init**.py]

### Checkable Tag Group Components

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ ModelScopeLayoutComponent <|-- AntdTimeline

**章节来源**

- [backend/modelscope_studio/components/antd/segmented/__init__.py]
- [backend/modelscope_studio/components/antd/segmented/**init**.py]

### Statistic 计数

Expand All @@ -441,7 +441,7 @@ ModelScopeLayoutComponent <|-- AntdTimeline

**章节来源**

- [backend/modelscope_studio/components/antd/statistic/__init__.py]
- [backend/modelscope_studio/components/antd/statistic/**init**.py]

### Table 表格

Expand All @@ -454,7 +454,7 @@ ModelScopeLayoutComponent <|-- AntdTimeline

**章节来源**

- [backend/modelscope_studio/components/antd/table/__init__.py]
- [backend/modelscope_studio/components/antd/table/**init**.py]

### Tabs 标签页

Expand All @@ -467,7 +467,7 @@ ModelScopeLayoutComponent <|-- AntdTimeline

**章节来源**

- [backend/modelscope_studio/components/antd/tabs/__init__.py]
- [backend/modelscope_studio/components/antd/tabs/**init**.py]

### Tag 标签

Expand Down Expand Up @@ -513,7 +513,7 @@ ModelScopeLayoutComponent <|-- AntdTimeline

**章节来源**

- [backend/modelscope_studio/components/antd/tooltip/__init__.py]
- [backend/modelscope_studio/components/antd/tooltip/**init**.py]

### Tour 导览

Expand All @@ -526,7 +526,7 @@ ModelScopeLayoutComponent <|-- AntdTimeline

**章节来源**

- [backend/modelscope_studio/components/antd/tour/__init__.py]
- [backend/modelscope_studio/components/antd/tour/**init**.py]

### Tree 树形控件

Expand All @@ -539,7 +539,7 @@ ModelScopeLayoutComponent <|-- AntdTimeline

**章节来源**

- [backend/modelscope_studio/components/antd/tree/__init__.py]
- [backend/modelscope_studio/components/antd/tree/**init**.py]

### 可勾选标签组组件

Expand Down
2 changes: 2 additions & 0 deletions backend/modelscope_studio/components/antd/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from .avatar.group import AntdAvatarGroup as AvatarGroup
from .badge import AntdBadge as Badge
from .badge.ribbon import AntdBadgeRibbon as BadgeRibbon
from .border_beam import AntdBorderBeam as BorderBeam
from .breadcrumb import AntdBreadcrumb as Breadcrumb
from .breadcrumb.item import AntdBreadcrumbItem as BreadcrumbItem
from .button import AntdButton as Button
Expand Down Expand Up @@ -70,6 +71,7 @@
from .list import AntdList as List
from .list.item import AntdListItem as ListItem
from .list.item.meta import AntdListItemMeta as ListItemMeta
from .listy import AntdListy as Listy
from .masonry import AntdMasonry as Masonry
from .masonry.item import AntdMasonryItem as MasonryItem
from .mentions import AntdMentions as Mentions
Expand Down
72 changes: 72 additions & 0 deletions backend/modelscope_studio/components/antd/border_beam/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
from __future__ import annotations

from typing import Any

from ....utils.dev import ModelScopeLayoutComponent, resolve_frontend_dir


class AntdBorderBeam(ModelScopeLayoutComponent):
"""
Ant Design: https://ant.design/components/border-beam

A decorative component that renders a flowing highlight animation along the
border of its child container.

When to use:
- Draw attention to a card, button or panel without changing its layout.
- Indicate an ongoing or AI-generated process in an ambient way.
"""

EVENTS = []

def __init__(
self,
additional_props: dict | None = None,
*,
color: str | list[dict] | None = None,
count: int | None = None,
duration: int | float | None = None,
line_width: int | float | str | None = None,
outset: int | float | str | None = None,
size: int | float | str | None = None,
as_item: str | None = None,
_internal: None = None,
# gradio properties
visible: bool = True,
elem_id: str | None = None,
elem_classes: list[str] | str | None = None,
elem_style: dict | None = None,
render: bool = True,
**kwargs):
super().__init__(visible=visible,
elem_id=elem_id,
elem_classes=elem_classes,
render=render,
as_item=as_item,
elem_style=elem_style,
**kwargs)
self.additional_props = additional_props
self.color = color
self.count = count
self.duration = duration
self.line_width = line_width
self.outset = outset
self.size = size

FRONTEND_DIR = resolve_frontend_dir("border-beam")

@property
def skip_api(self):
return True

def preprocess(self, payload: None) -> None:
return payload

def postprocess(self, value: None) -> None:
return value

def example_payload(self) -> Any:
return None

def example_value(self) -> Any:
return None
2 changes: 2 additions & 0 deletions backend/modelscope_studio/components/antd/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from .avatar.group import AntdAvatarGroup
from .badge import AntdBadge
from .badge.ribbon import AntdBadgeRibbon
from .border_beam import AntdBorderBeam
from .breadcrumb import AntdBreadcrumb
from .breadcrumb.item import AntdBreadcrumbItem
from .button import AntdButton
Expand Down Expand Up @@ -67,6 +68,7 @@
from .list import AntdList
from .list.item import AntdListItem
from .list.item.meta import AntdListItemMeta
from .listy import AntdListy
from .masonry import AntdMasonry
from .masonry.item import AntdMasonryItem
from .mentions import AntdMentions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
'ko_KR', 'ku_IQ', 'lt_LT', 'lv_LV', 'mk_MK', 'ml_IN',
'mn_MN', 'ms_MY', 'my_MM', 'nb_NO', 'ne_NP', 'nl_BE',
'nl_NL', 'pl_PL', 'pt_BR', 'pt_PT', 'ro_RO', 'ru_RU',
'si_LK', 'sk_SK', 'sl_SI', 'sr_RS', 'sv_SE', 'ta_IN',
'th_TH', 'tk_TK', 'tr_TR', 'uk_UA', 'ur_PK', 'uz_UZ',
'vi_VN', 'zh_CN', 'zh_HK', 'zh_TW']
'si_LK', 'sk_SK', 'sl_SI', 'sq_AL', 'sr_RS', 'sv_SE',
'ta_IN', 'th_TH', 'tk_TK', 'tr_TR', 'uk_UA', 'ur_PK',
'uz_UZ', 'vi_VN', 'zh_CN', 'zh_HK', 'zh_TW']


class AntdConfigProvider(ModelScopeLayoutComponent):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ class AntdDatePicker(ModelScopeDataLayoutComponent):
EventListener("open_change",
callback=lambda block: block._internal.update(
bind_openChange_event=True)),
EventListener("clear",
callback=lambda block: block._internal.update(
bind_clear_event=True)),
]

# supported slots
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ class AntdDatePickerRangePicker(ModelScopeDataLayoutComponent):
EventListener("blur",
callback=lambda block: block._internal.update(
bind_blur_event=True)),
EventListener("clear",
callback=lambda block: block._internal.update(
bind_clear_event=True)),
]

# supported slots
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,11 @@ def __init__(
menu: dict | None = None,
overlay_class_name: str | None = None,
overlay_style: dict | None = None,
placement: Literal['topLeft', 'top', 'topRight', 'bottomLeft',
'bottom', 'bottomRight'] = "bottomLeft",
placement: Literal['topLeft', 'topCenter', 'topRight',
'bottomLeft', 'bottomCenter', 'bottomRight',
'top', 'bottom', 'left', 'leftTop',
'leftBottom', 'right', 'rightTop',
'rightBottom'] = "bottomLeft",
trigger: list[Literal['click', 'hover',
'contextMenu']] = ['hover'],
open: bool | None = None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,11 @@ def __init__(
menu: dict | None = None,
overlay_class_name: str | None = None,
overlay_style: dict | None = None,
placement: Literal['topLeft', 'top', 'topRight', 'bottomLeft',
'bottom', 'bottomRight'] = "bottomLeft",
placement: Literal['topLeft', 'topCenter', 'topRight',
'bottomLeft', 'bottomCenter', 'bottomRight',
'top', 'bottom', 'left', 'leftTop',
'leftBottom', 'right', 'rightTop',
'rightBottom'] = "bottomLeft",
trigger: list[Literal['click', 'hover',
'contextMenu']] = ['hover'],
open: bool | None = None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def __init__(
badge: dict | None = None,
duration: int | float = 450,
get_target: str | None = None,
show_progress: bool | None = None,
visibility_height: int | float = 400,
root_class_name: str | None = None,
class_names: dict | str | None = None,
Expand Down Expand Up @@ -93,6 +94,7 @@ def __init__(
self.duration = duration
self.visibility_height = visibility_height
self.get_target = get_target
self.show_progress = show_progress
self.root_class_name = root_class_name

FRONTEND_DIR = resolve_frontend_dir("float-button", "back-top")
Expand Down
Loading
Loading