Skip to content

Commit 1cd2ed1

Browse files
committed
refactor(antdx): components migration
1 parent 254201c commit 1cd2ed1

6 files changed

Lines changed: 49 additions & 36 deletions

File tree

frontend/base/auto-loading/Index.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
} = getComponentProps();
3434
return {
3535
gradio,
36-
additionalProps: getAdditionalProps(),
36+
additionalProps: getAdditionalProps(),
3737
restProps,
3838
_internal,
3939
as_item,

frontend/base/fragment/Index.svelte

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@
99
1010
const props = $props();
1111
12-
const { gradio, getComponentProps, getAdditionalProps, children } = getProps<{}>(
13-
() => props
14-
);
12+
const { gradio, getComponentProps, getAdditionalProps, children } =
13+
getProps<{}>(() => props);
1514
1615
const getProceedProps = processProps(
1716
() => {

frontend/pro/chatbot/type.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,10 @@ export interface ChatbotUserActionObject {
7474
popconfirm?: string | PopconfirmProps;
7575
}
7676

77-
export interface ChatbotUserConfig
78-
extends Omit<BubbleProps, 'avatar' | 'content'> {
77+
export interface ChatbotUserConfig extends Omit<
78+
BubbleProps,
79+
'avatar' | 'content'
80+
> {
7981
actions?: (ChatbotUserAction | ChatbotUserActionObject)[];
8082
disabled_actions?: ChatbotUserAction[];
8183
avatar?: ChatbotAvatar;
@@ -94,8 +96,10 @@ export interface ChatbotBotActionObject {
9496
popconfirm?: string | PopconfirmProps;
9597
}
9698

97-
export interface ChatbotBotConfig
98-
extends Omit<BubbleProps, 'avatar' | 'content'> {
99+
export interface ChatbotBotConfig extends Omit<
100+
BubbleProps,
101+
'avatar' | 'content'
102+
> {
99103
actions?: (ChatbotBotAction | ChatbotBotActionObject)[];
100104
disabled_actions?: ChatbotBotAction[];
101105
avatar?: ChatbotAvatar;

frontend/pro/monaco-editor/Index.svelte

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,25 @@
1212
const AwaitedMonacoEditor = importComponent(() => import('./monaco-editor'));
1313
1414
const props = $props();
15-
const { gradio, getComponentProps, getAdditionalProps, children, updateProps } =
16-
getProps<{
17-
additional_props?: Record<string, any>;
15+
const {
16+
gradio,
17+
getComponentProps,
18+
getAdditionalProps,
19+
children,
20+
updateProps,
21+
} = getProps<{
22+
additional_props?: Record<string, any>;
1823
19-
as_item?: string | undefined;
20-
_internal: {
21-
layout?: boolean;
22-
};
23-
value?: string | undefined;
24-
_loader?: {
25-
mode?: 'cdn' | 'local';
26-
cdn_url?: string;
27-
};
28-
}>(() => props);
24+
as_item?: string | undefined;
25+
_internal: {
26+
layout?: boolean;
27+
};
28+
value?: string | undefined;
29+
_loader?: {
30+
mode?: 'cdn' | 'local';
31+
cdn_url?: string;
32+
};
33+
}>(() => props);
2934
3035
const getProceedProps = processProps(() => {
3136
const {

frontend/pro/multimodal-input/Index.svelte

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,25 @@
1515
);
1616
1717
const props = $props();
18-
const { gradio, getComponentProps, getAdditionalProps, children, updateProps } =
19-
getProps<{
20-
additional_props?: Record<string, any>;
18+
const {
19+
gradio,
20+
getComponentProps,
21+
getAdditionalProps,
22+
children,
23+
updateProps,
24+
} = getProps<{
25+
additional_props?: Record<string, any>;
2126
22-
as_item?: string | undefined;
23-
_internal: {
24-
layout?: boolean;
25-
};
26-
value?: MultimodalInputValue;
27-
root?: string;
28-
key_press?: any;
29-
paste_file?: any;
30-
key_down?: any;
31-
}>(() => props);
27+
as_item?: string | undefined;
28+
_internal: {
29+
layout?: boolean;
30+
};
31+
value?: MultimodalInputValue;
32+
root?: string;
33+
key_press?: any;
34+
paste_file?: any;
35+
key_down?: any;
36+
}>(() => props);
3237
3338
const getProceedProps = processProps(
3439
() => {
@@ -45,7 +50,7 @@
4550
} = getComponentProps();
4651
return {
4752
gradio,
48-
additionalProps: getAdditionalProps(),
53+
additionalProps: getAdditionalProps(),
4954
_internal,
5055
as_item,
5156
restProps,

frontend/pro/web-sandbox/Index.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
} = getComponentProps();
4040
return {
4141
gradio,
42-
additionalProps: getAdditionalProps(),
42+
additionalProps: getAdditionalProps(),
4343
_internal,
4444
as_item,
4545
restProps,

0 commit comments

Comments
 (0)