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

fix: ensure the same key and value in the tree data
14 changes: 14 additions & 0 deletions .changeset/hip-apes-bathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
'@modelscope-studio/legacy-waterfall-gallery': patch
'@modelscope-studio/legacy-multimodal-input': patch
'@modelscope-studio/legacy-markdown': patch
'@modelscope-studio/legacy-compiled': patch
'@modelscope-studio/legacy-flow': patch
'@modelscope-studio/lint-config': patch
'@modelscope-studio/changelog': patch
'@modelscope-studio/antd': patch
'@modelscope-studio/frontend': patch
'modelscope_studio': patch
---

chore: update deps
5 changes: 5 additions & 0 deletions .changeset/yellow-tables-dance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@modelscope-studio/antd': patch
---

fix: ensure the load_data event returns a Promise
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.0.0",
"@types/node": "^24.0.10",
"tsup": "^8.5.0"
}
}
20 changes: 10 additions & 10 deletions config/lint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@
}
},
"dependencies": {
"@eslint/compat": "^1.2.9",
"@eslint/js": "^9.28.0",
"@typescript-eslint/parser": "^8.34.0",
"@eslint/compat": "^1.3.1",
"@eslint/js": "^9.30.1",
"@typescript-eslint/parser": "^8.35.1",
"eslint-config-prettier": "^10.1.5",
"eslint-import-resolver-typescript": "^4.4.3",
"eslint-plugin-import": "^2.31.0",
"eslint-import-resolver-typescript": "^4.4.4",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-prettier": "5.4.1",
"eslint-plugin-prettier": "5.5.1",
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-hooks": "^5.2.0",
"eslint-plugin-react-refresh": "^0.4.20",
"eslint-plugin-simple-import-sort": "^12.1.0",
"eslint-plugin-svelte": "^3.9.2",
"globals": "^16.2.0",
"postcss": "^8.5.4",
"eslint-plugin-svelte": "^3.10.1",
"globals": "^16.3.0",
"postcss": "^8.5.6",
"postcss-less": "^6.0.0",
"stylelint-config-ali": "^2.1.2",
"stylelint-config-rational-order": "^0.1.2",
Expand All @@ -39,7 +39,7 @@
"stylelint-order": "^7.0.0",
"stylelint-prettier": "^5.0.3",
"svelte-eslint-parser": "^1.2.0",
"typescript-eslint": "^8.34.0"
"typescript-eslint": "^8.35.1"
},
"devDependencies": {
"@types/eslint": "^9.6.1",
Expand Down
21 changes: 19 additions & 2 deletions frontend/antd/tree-select/tree-select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,28 @@ export const TreeSelect = sveltify<
const componentProps: TreeSelectProps = useMemo(() => {
return {
...props,
loadData: onLoadData,
// eslint-disable-next-line require-await
loadData: async (...args) => onLoadData?.(...args),
treeData:
treeData ||
renderItems<NonNullable<TreeSelectProps['treeData']>[number]>(
resolvedSlotItems,
{ clone: true }
{
clone: true,
itemPropsTransformer: (itemProps) => {
if (
itemProps.value &&
itemProps.key &&
itemProps.value !== itemProps.key
) {
return {
...itemProps,
key: undefined,
};
}
return itemProps;
},
}
),
dropdownRender: slots.dropdownRender
? renderParamsSlot({ slots, setSlotParams, key: 'dropdownRender' })
Expand Down Expand Up @@ -131,6 +147,7 @@ export const TreeSelect = sveltify<
treeData,
treeTitleRenderFunction,
]);

return (
<>
<div style={{ display: 'none' }}>{children}</div>
Expand Down
16 changes: 15 additions & 1 deletion frontend/antd/tree/tree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,19 @@ export const Tree = sveltify<
resolvedSlotItems,
{
clone: true,
itemPropsTransformer: (itemProps) => {
if (
itemProps.value &&
itemProps.key &&
itemProps.value !== itemProps.key
) {
return {
...itemProps,
key: undefined,
};
}
return itemProps;
},
}
),
showLine: slots['showLine.showLeafIcon']
Expand Down Expand Up @@ -101,7 +114,8 @@ export const Tree = sveltify<
nodeDraggable: draggableNodeDraggableFunction,
}
: draggableFunction || draggable,
loadData: onLoadData,
// eslint-disable-next-line require-await
loadData: async (...args: any[]) => onLoadData?.(...args),
};
}, [
props,
Expand Down
2 changes: 1 addition & 1 deletion frontend/legacy/Flow/Awaited.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
};
}
}
$: background_props, update_background_props();
$: (background_props, update_background_props());
// process schema
$: _schema = {
...schema,
Expand Down
2 changes: 1 addition & 1 deletion frontend/legacy/Markdown/Awaited.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
: src.replaceAll('/file=', replaceStr);
};
$: _value = redirect_src_url(value);
$: label, gradio.dispatch('change');
$: (label, gradio.dispatch('change'));
</script>

<Block
Expand Down
2 changes: 1 addition & 1 deletion frontend/legacy/Markdown/shared/Markdown.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
dispatch('custom', { tag, tag_index, value: v });
}

$: value, dispatch('change');
$: (value, dispatch('change'));
</script>

<div
Expand Down
4 changes: 2 additions & 2 deletions frontend/legacy/MultimodalInput/shared/Input.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
let previous_scroll_top = 0;
let user_has_scrolled_up = false;

$: value, el && lines !== max_lines && resize({ target: el });
$: (value, el && lines !== max_lines && resize({ target: el }));

$: if (value === null) value = '';

Expand Down Expand Up @@ -68,7 +68,7 @@
}
value_is_output = false;
});
$: value, handle_change();
$: (value, handle_change());

async function handle_copy(): Promise<void> {
if ('clipboard' in navigator) {
Expand Down
2 changes: 1 addition & 1 deletion frontend/legacy/WaterfallGallery/Index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
gradio.dispatch('like', data);
};

$: selected_index, dispatch('prop_change', { selected_index });
$: (selected_index, dispatch('prop_change', { selected_index }));
</script>

<Block
Expand Down
2 changes: 1 addition & 1 deletion frontend/legacy/WaterfallGallery/shared/Gallery.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@
});
}
$: if (waterfall_grid_el) {
cols, createWaterfall();
(cols, createWaterfall());
}

onDestroy(() => {
Expand Down
2 changes: 1 addition & 1 deletion frontend/legacy/compiled/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@subscribe-kit/core": "^2.1.1",
"@subscribe-kit/react": "^2.1.1",
"@ungap/structured-clone": "^1.3.0",
"@xyflow/react": "12.6.4",
"@xyflow/react": "12.8.1",
"ajv": "^8.17.1",
"ajv-i18n": "^4.2.0",
"deepmerge": "^4.3.1",
Expand Down
18 changes: 9 additions & 9 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"@ant-design/cssinjs": "^1.23.0",
"@ant-design/icons": "^6.0.0",
"@ant-design/x": "^1.4.0",
"@babel/standalone": "^7.27.6",
"@babel/standalone": "^7.27.7",
"@gradio/atoms": "0.7.4",
"@gradio/button": "^0.2.43",
"@gradio/client": "^1.14.2",
Expand All @@ -19,28 +19,28 @@
"@gradio/upload": "0.11.2",
"@gradio/utils": "0.9.0",
"amuchina": "^1.0.12",
"antd": "^5.26.0",
"antd": "^5.26.3",
"classnames": "^2.5.1",
"dayjs": "^1.11.12",
"dequal": "^2.0.2",
"github-slugger": "^2.0.0",
"immer": "^10.1.1",
"katex": "^0.16.22",
"lodash-es": "^4.17.21",
"marked": "^15.0.12",
"marked-gfm-heading-id": "^4.1.1",
"marked-highlight": "^2.2.1",
"mermaid": "^11.6.0",
"marked": "^16.0.0",
"marked-gfm-heading-id": "^4.1.2",
"marked-highlight": "^2.2.2",
"mermaid": "^11.7.0",
"path-browserify-esm": "^1.0.6",
"prismjs": "^1.30.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"svelte": "^4.2.19",
"svelte-i18n": "^4.0.1",
"wavesurfer.js": "^7.9.5"
"wavesurfer.js": "^7.9.9"
},
"devDependencies": {
"@babel/core": "^7.27.4",
"@babel/core": "^7.27.7",
"@types/babel__core": "^7.20.5",
"@types/babel__standalone": "^7.1.9",
"@types/katex": "^0.16.7",
Expand All @@ -53,7 +53,7 @@
"fast-glob": "^3.3.3",
"less": "^4.3.0",
"typescript-json-schema": "^0.65.1",
"vite": "^6.3.5"
"vite": "^7.0.0"
},
"main_changeset": true
}
14 changes: 10 additions & 4 deletions frontend/utils/renderItems.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export function renderItems<R>(
fallback?: (item: any) => R;
clone?: boolean;
forceClone?: boolean;
itemPropsTransformer?: (props: Record<string, any>) => Record<string, any>;
},
key?: React.Key
): undefined | R[] {
Expand All @@ -26,10 +27,15 @@ export function renderItems<R>(
}
return item;
}
const result = {
...item.props,
key: item.props?.key ?? (key ? `${key}-${i}` : `${i}`),
};
const result = options?.itemPropsTransformer
? options?.itemPropsTransformer({
...item.props,
key: item.props?.key ?? (key ? `${key}-${i}` : `${i}`),
})
: {
...item.props,
key: item.props?.key ?? (key ? `${key}-${i}` : `${i}`),
};

let current = result;
Object.keys(item.slots).forEach((slotKey) => {
Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,26 +27,26 @@
"@actions/core": "^1.11.1",
"@actions/exec": "^1.1.1",
"@actions/github": "^6.0.1",
"@changesets/cli": "^2.29.4",
"@changesets/cli": "^2.29.5",
"@commitlint/cli": "^19.8.1",
"@commitlint/config-conventional": "^19.8.1",
"@manypkg/get-packages": "^3.0.0",
"@modelscope-studio/changelog": "workspace:*",
"@modelscope-studio/lint-config": "workspace:*",
"eslint": "^9.28.0",
"eslint": "^9.30.1",
"husky": "^9.1.7",
"lint-staged": "^16.1.0",
"lint-staged": "^16.1.2",
"node-fetch": "^3.3.2",
"npm-run-all": "^4.1.5",
"prettier": "^3.5.3",
"prettier-plugin-packagejson": "^2.5.15",
"prettier": "^3.6.2",
"prettier-plugin-packagejson": "^2.5.17",
"prettier-plugin-svelte": "^3.4.0",
"rimraf": "^6.0.1",
"stylelint": "^16.20.0",
"stylelint": "^16.21.0",
"svelte": "^4.2.19",
"svelte-check": "^4.2.1",
"svelte-check": "^4.2.2",
"tslib": "^2.8.1",
"tsx": "^4.20.0",
"tsx": "^4.20.3",
"typescript": "^5.8.3"
},
"main_changeset": true
Expand Down
Loading