@gradio/core 0.4.1 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,42 @@
1
1
  # @gradio/core
2
2
 
3
+ ## 0.5.0
4
+
5
+ ### Features
6
+
7
+ - [#10166](https://github.com/gradio-app/gradio/pull/10166) [`8ac5b13`](https://github.com/gradio-app/gradio/commit/8ac5b13c96f871ac4b0f13c6ebfbb5559a18bcc2) - Add Japanese translations for login UI. Thanks @kazuhitoyokoi!
8
+ - [#10159](https://github.com/gradio-app/gradio/pull/10159) [`7ca3685`](https://github.com/gradio-app/gradio/commit/7ca36850c9e46a1eb5b7a3866b4b166776b4146f) - Add Japanese message into message catalog. Thanks @kazuhitoyokoi!
9
+
10
+ ### Fixes
11
+
12
+ - [#10170](https://github.com/gradio-app/gradio/pull/10170) [`5e6e234`](https://github.com/gradio-app/gradio/commit/5e6e234cba820d29ebe29de2597d36ab3683093b) - Custom component in rerender. Thanks @aliabid94!
13
+
14
+ ### Dependency updates
15
+
16
+ - @gradio/code@0.10.10
17
+ - @gradio/paramviewer@0.6.1
18
+ - @gradio/video@0.12.1
19
+ - @gradio/statustracker@0.9.7
20
+ - @gradio/upload@0.14.3
21
+ - @gradio/button@0.3.9
22
+ - @gradio/atoms@0.12.0
23
+ - @gradio/image@0.19.0
24
+ - @gradio/gallery@0.14.0
25
+ - @gradio/plot@0.9.4
26
+ - @gradio/file@0.11.3
27
+ - @gradio/column@0.2.0
28
+ - @gradio/textbox@0.9.1
29
+ - @gradio/checkbox@0.4.9
30
+
31
+ ## 0.4.1
32
+
33
+ ### Dependency updates
34
+
35
+ - @gradio/gallery@0.13.10
36
+ - @gradio/paramviewer@0.6.0
37
+ - @gradio/image@0.18.0
38
+ - @gradio/video@0.12.0
39
+
3
40
  ## 0.4.1
4
41
 
5
42
  ### Fixes
@@ -320,7 +320,7 @@ async function trigger_api_call(dep_index, trigger_id = null, event_data = null)
320
320
  rerender_layout({
321
321
  components: _components,
322
322
  layout: render_layout,
323
- root,
323
+ root: root + api_prefix,
324
324
  dependencies,
325
325
  render_id
326
326
  });
@@ -47,7 +47,7 @@ const submit = async () => {
47
47
  <Block>
48
48
  <Textbox
49
49
  {root}
50
- label="username"
50
+ label={$_("login.username")}
51
51
  lines={1}
52
52
  show_label={true}
53
53
  max_lines={1}
@@ -59,7 +59,7 @@ const submit = async () => {
59
59
  <Block>
60
60
  <Textbox
61
61
  {root}
62
- label="password"
62
+ label={$_("login.password")}
63
63
  lines={1}
64
64
  show_label={true}
65
65
  max_lines={1}
package/dist/src/init.js CHANGED
@@ -73,7 +73,7 @@ export function create_components(initial_layout) {
73
73
  acc[c.id] = c;
74
74
  return acc;
75
75
  }, {});
76
- await walk_layout(layout, root);
76
+ await walk_layout(layout, root, _components);
77
77
  layout_store.set(_rootNode);
78
78
  set_event_specific_args(dependencies);
79
79
  }
@@ -121,17 +121,17 @@ export function create_components(initial_layout) {
121
121
  if (current_element.parent) {
122
122
  current_element.parent.children[current_element.parent.children.indexOf(current_element)] = instance_map[layout.id];
123
123
  }
124
- walk_layout(layout, root, current_element.parent).then(() => {
124
+ walk_layout(layout, root, _components.concat(components), current_element.parent).then(() => {
125
125
  layout_store.set(_rootNode);
126
126
  });
127
127
  set_event_specific_args(dependencies);
128
128
  }
129
- async function walk_layout(node, root, parent) {
129
+ async function walk_layout(node, root, components, parent) {
130
130
  const instance = instance_map[node.id];
131
131
  instance.component = (await constructor_map.get(instance.component_class_id || instance.type))?.default;
132
132
  instance.parent = parent;
133
133
  if (instance.type === "dataset") {
134
- instance.props.component_map = get_component(instance.type, instance.component_class_id, root, _components, instance.props.components).example_components;
134
+ instance.props.component_map = get_component(instance.type, instance.component_class_id, root, components, instance.props.components).example_components;
135
135
  }
136
136
  if (_target_map[instance.id]) {
137
137
  instance.props.attached_events = Object.keys(_target_map[instance.id]);
@@ -144,7 +144,7 @@ export function create_components(initial_layout) {
144
144
  }
145
145
  _component_map.set(instance.id, instance);
146
146
  if (node.children) {
147
- instance.children = await Promise.all(node.children.map((v) => walk_layout(v, root, instance)));
147
+ instance.children = await Promise.all(node.children.map((v) => walk_layout(v, root, components, instance)));
148
148
  }
149
149
  if (instance.type === "tabs" && !instance.props.initial_tabs) {
150
150
  const tab_items_props = node.children?.map((c) => {
@@ -97,6 +97,8 @@
97
97
  "login": {
98
98
  "enable_cookies": "If you are visiting a HuggingFace Space in Incognito mode, you must enable third party cookies.",
99
99
  "incorrect_credentials": "Incorrect Credentials",
100
+ "username": "username",
101
+ "password": "password",
100
102
  "login": "Login"
101
103
  },
102
104
  "number": {
@@ -5,6 +5,15 @@
5
5
  "or": "または",
6
6
  "submit": "送信"
7
7
  },
8
+ "errors": {
9
+ "use_via_api": "API経由で使おう"
10
+ },
11
+ "login": {
12
+ "incorrect_credentials": "認証情報が正しくありません",
13
+ "username": "ユーザ名",
14
+ "password": "パスワード",
15
+ "login": "ログイン"
16
+ },
8
17
  "upload_text": {
9
18
  "click_to_upload": "クリックしてアップロード",
10
19
  "drop_audio": "ここに音声をドロップ",
package/package.json CHANGED
@@ -1,64 +1,64 @@
1
1
  {
2
2
  "name": "@gradio/core",
3
- "version": "0.4.1",
3
+ "version": "0.5.0",
4
4
  "type": "module",
5
5
  "devDependencies": {
6
- "@gradio/accordion": "^0.5.2",
7
- "@gradio/annotatedimage": "^0.8.9",
8
- "@gradio/atoms": "^0.11.2",
9
- "@gradio/audio": "^0.14.9",
10
- "@gradio/button": "^0.3.8",
11
- "@gradio/box": "^0.2.7",
12
- "@gradio/chatbot": "^0.17.0",
13
- "@gradio/checkbox": "^0.4.8",
6
+ "@gradio/accordion": "^0.5.3",
7
+ "@gradio/annotatedimage": "^0.9.0",
8
+ "@gradio/atoms": "^0.12.0",
9
+ "@gradio/audio": "^0.14.10",
10
+ "@gradio/box": "^0.2.8",
11
+ "@gradio/button": "^0.3.9",
12
+ "@gradio/chatbot": "^0.19.0",
13
+ "@gradio/checkbox": "^0.4.9",
14
+ "@gradio/checkboxgroup": "^0.6.9",
14
15
  "@gradio/client": "^1.8.0",
15
- "@gradio/checkboxgroup": "^0.6.8",
16
- "@gradio/code": "^0.10.9",
17
- "@gradio/colorpicker": "^0.4.8",
16
+ "@gradio/code": "^0.10.10",
17
+ "@gradio/colorpicker": "^0.4.9",
18
18
  "@gradio/column": "^0.2.0",
19
- "@gradio/dataframe": "^0.12.4",
20
- "@gradio/dataset": "^0.3.10",
21
- "@gradio/datetime": "^0.3.0",
22
- "@gradio/downloadbutton": "^0.2.8",
23
- "@gradio/dropdown": "^0.9.6",
24
- "@gradio/fallback": "^0.4.8",
25
- "@gradio/file": "^0.11.2",
26
- "@gradio/fileexplorer": "^0.5.9",
27
- "@gradio/form": "^0.2.7",
28
- "@gradio/gallery": "^0.13.9",
19
+ "@gradio/dataframe": "^0.12.5",
20
+ "@gradio/datetime": "^0.3.1",
21
+ "@gradio/dataset": "^0.3.11",
22
+ "@gradio/downloadbutton": "^0.2.9",
23
+ "@gradio/dropdown": "^0.9.7",
24
+ "@gradio/fallback": "^0.4.9",
25
+ "@gradio/file": "^0.11.3",
26
+ "@gradio/fileexplorer": "^0.5.10",
27
+ "@gradio/form": "^0.2.8",
28
+ "@gradio/gallery": "^0.14.0",
29
29
  "@gradio/group": "^0.2.0",
30
- "@gradio/html": "^0.5.0",
31
- "@gradio/highlightedtext": "^0.8.8",
32
- "@gradio/image": "^0.17.0",
30
+ "@gradio/html": "^0.6.0",
31
+ "@gradio/highlightedtext": "^0.8.9",
33
32
  "@gradio/icons": "^0.8.1",
34
- "@gradio/imageeditor": "^0.11.9",
35
- "@gradio/json": "^0.5.8",
36
- "@gradio/label": "^0.5.0",
33
+ "@gradio/image": "^0.19.0",
34
+ "@gradio/imageeditor": "^0.11.11",
35
+ "@gradio/json": "^0.5.9",
36
+ "@gradio/label": "^0.5.1",
37
37
  "@gradio/browserstate": "^0.2.0",
38
- "@gradio/markdown": "^0.12.0",
39
- "@gradio/model3d": "^0.13.9",
40
- "@gradio/multimodaltextbox": "^0.7.7",
41
- "@gradio/nativeplot": "^0.5.2",
42
- "@gradio/number": "^0.5.8",
43
- "@gradio/paramviewer": "^0.5.8",
44
- "@gradio/plot": "^0.9.3",
45
- "@gradio/radio": "^0.6.8",
46
- "@gradio/simpledropdown": "^0.3.8",
38
+ "@gradio/markdown": "^0.12.1",
39
+ "@gradio/model3d": "^0.13.10",
40
+ "@gradio/multimodaltextbox": "^0.8.0",
41
+ "@gradio/nativeplot": "^0.5.3",
42
+ "@gradio/number": "^0.5.9",
43
+ "@gradio/paramviewer": "^0.6.1",
44
+ "@gradio/plot": "^0.9.4",
45
+ "@gradio/radio": "^0.6.9",
47
46
  "@gradio/row": "^0.2.0",
48
- "@gradio/simpleimage": "^0.8.9",
49
- "@gradio/simpletextbox": "^0.3.8",
50
- "@gradio/slider": "^0.5.8",
47
+ "@gradio/simpledropdown": "^0.3.9",
48
+ "@gradio/simpleimage": "^0.8.10",
49
+ "@gradio/simpletextbox": "^0.3.9",
50
+ "@gradio/slider": "^0.5.9",
51
51
  "@gradio/state": "^0.1.2",
52
- "@gradio/statustracker": "^0.9.6",
53
52
  "@gradio/tabitem": "^0.3.5",
54
- "@gradio/textbox": "^0.9.0",
53
+ "@gradio/statustracker": "^0.9.7",
55
54
  "@gradio/tabs": "^0.3.5",
55
+ "@gradio/textbox": "^0.9.1",
56
56
  "@gradio/theme": "^0.3.0",
57
57
  "@gradio/timer": "^0.4.2",
58
- "@gradio/upload": "^0.14.2",
59
- "@gradio/uploadbutton": "^0.7.8",
58
+ "@gradio/upload": "^0.14.3",
59
+ "@gradio/uploadbutton": "^0.7.9",
60
60
  "@gradio/utils": "^0.9.0",
61
- "@gradio/video": "^0.11.9",
61
+ "@gradio/video": "^0.12.1",
62
62
  "@gradio/wasm": "^0.15.0"
63
63
  },
64
64
  "msw": {
package/src/Blocks.svelte CHANGED
@@ -412,7 +412,7 @@
412
412
  rerender_layout({
413
413
  components: _components,
414
414
  layout: render_layout,
415
- root: root,
415
+ root: root + api_prefix,
416
416
  dependencies: dependencies,
417
417
  render_id: render_id
418
418
  });
package/src/Login.svelte CHANGED
@@ -51,7 +51,7 @@
51
51
  <Block>
52
52
  <Textbox
53
53
  {root}
54
- label="username"
54
+ label={$_("login.username")}
55
55
  lines={1}
56
56
  show_label={true}
57
57
  max_lines={1}
@@ -63,7 +63,7 @@
63
63
  <Block>
64
64
  <Textbox
65
65
  {root}
66
- label="password"
66
+ label={$_("login.password")}
67
67
  lines={1}
68
68
  show_label={true}
69
69
  max_lines={1}
package/src/init.ts CHANGED
@@ -154,7 +154,7 @@ export function create_components(initial_layout: ComponentMeta | undefined): {
154
154
  {} as { [id: number]: ComponentMeta }
155
155
  );
156
156
 
157
- await walk_layout(layout, root);
157
+ await walk_layout(layout, root, _components);
158
158
 
159
159
  layout_store.set(_rootNode);
160
160
  set_event_specific_args(dependencies);
@@ -230,7 +230,12 @@ export function create_components(initial_layout: ComponentMeta | undefined): {
230
230
  ] = instance_map[layout.id];
231
231
  }
232
232
 
233
- walk_layout(layout, root, current_element.parent).then(() => {
233
+ walk_layout(
234
+ layout,
235
+ root,
236
+ _components.concat(components),
237
+ current_element.parent
238
+ ).then(() => {
234
239
  layout_store.set(_rootNode);
235
240
  });
236
241
 
@@ -240,6 +245,7 @@ export function create_components(initial_layout: ComponentMeta | undefined): {
240
245
  async function walk_layout(
241
246
  node: LayoutNode,
242
247
  root: string,
248
+ components: ComponentMeta[],
243
249
  parent?: ComponentMeta
244
250
  ): Promise<ComponentMeta> {
245
251
  const instance = instance_map[node.id];
@@ -254,7 +260,7 @@ export function create_components(initial_layout: ComponentMeta | undefined): {
254
260
  instance.type,
255
261
  instance.component_class_id,
256
262
  root,
257
- _components,
263
+ components,
258
264
  instance.props.components
259
265
  ).example_components;
260
266
  }
@@ -288,7 +294,7 @@ export function create_components(initial_layout: ComponentMeta | undefined): {
288
294
 
289
295
  if (node.children) {
290
296
  instance.children = await Promise.all(
291
- node.children.map((v) => walk_layout(v, root, instance))
297
+ node.children.map((v) => walk_layout(v, root, components, instance))
292
298
  );
293
299
  }
294
300
 
package/src/lang/en.json CHANGED
@@ -97,6 +97,8 @@
97
97
  "login": {
98
98
  "enable_cookies": "If you are visiting a HuggingFace Space in Incognito mode, you must enable third party cookies.",
99
99
  "incorrect_credentials": "Incorrect Credentials",
100
+ "username": "username",
101
+ "password": "password",
100
102
  "login": "Login"
101
103
  },
102
104
  "number": {
package/src/lang/ja.json CHANGED
@@ -5,6 +5,15 @@
5
5
  "or": "または",
6
6
  "submit": "送信"
7
7
  },
8
+ "errors": {
9
+ "use_via_api": "API経由で使おう"
10
+ },
11
+ "login": {
12
+ "incorrect_credentials": "認証情報が正しくありません",
13
+ "username": "ユーザ名",
14
+ "password": "パスワード",
15
+ "login": "ログイン"
16
+ },
8
17
  "upload_text": {
9
18
  "click_to_upload": "クリックしてアップロード",
10
19
  "drop_audio": "ここに音声をドロップ",