@gradio/core 0.29.1 → 0.29.2

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,11 @@
1
1
  # @gradio/core
2
2
 
3
+ ## 0.29.2
4
+
5
+ ### Fixes
6
+
7
+ - [#11994](https://github.com/gradio-app/gradio/pull/11994) [`d6f591e`](https://github.com/gradio-app/gradio/commit/d6f591e823dad8e7387de4124fa1e3ab16203a73) - Add render_children parameter to Tab component. Thanks @freddyaboulton!
8
+
3
9
  ## 0.29.1
4
10
 
5
11
  ### Fixes
package/dist/src/init.js CHANGED
@@ -622,8 +622,11 @@ function get_selected_tab_id(component, layout, components) {
622
622
  function process_children_visibility(layout, components, parent_tabs_context) {
623
623
  const visible_components = new Set();
624
624
  if (layout.children) {
625
+ const layout_component = components.find((c) => c.id === layout.id);
625
626
  for (const child of layout.children) {
626
- const child_visible = determine_visible_components(child, components, true, parent_tabs_context);
627
+ const child_visible = determine_visible_components(child, components, layout_component?.type === "tabitem"
628
+ ? layout_component.props.children_visible !== false
629
+ : true, parent_tabs_context);
627
630
  child_visible.forEach((id) => visible_components.add(id));
628
631
  }
629
632
  }
@@ -658,7 +661,9 @@ function determine_visible_components(layout, components, parent_visible = true,
658
661
  child_visible.forEach((id) => visible_components.add(id));
659
662
  }
660
663
  else if (component.type === "tabitem") {
661
- if (is_tab_item_visible(component, component_visible, parent_tabs_context)) {
664
+ const tab_item_visible = is_tab_item_visible(component, component_visible, parent_tabs_context);
665
+ if (tab_item_visible ||
666
+ (!tab_item_visible && component.props.render_children)) {
662
667
  visible_components.add(layout.id);
663
668
  const child_visible = process_children_visibility(layout, components, parent_tabs_context);
664
669
  child_visible.forEach((id) => visible_components.add(id));
package/package.json CHANGED
@@ -1,68 +1,68 @@
1
1
  {
2
2
  "name": "@gradio/core",
3
- "version": "0.29.1",
3
+ "version": "0.29.2",
4
4
  "type": "module",
5
5
  "devDependencies": {
6
6
  "@gradio/accordion": "^0.5.24",
7
7
  "@gradio/annotatedimage": "^0.10.0",
8
8
  "@gradio/atoms": "^0.18.1",
9
9
  "@gradio/audio": "^0.19.2",
10
- "@gradio/browserstate": "^0.3.2",
11
- "@gradio/box": "^0.2.25",
12
10
  "@gradio/button": "^0.5.13",
11
+ "@gradio/box": "^0.2.25",
12
+ "@gradio/checkbox": "^0.4.31",
13
13
  "@gradio/chatbot": "^0.27.0",
14
+ "@gradio/browserstate": "^0.3.2",
14
15
  "@gradio/checkboxgroup": "^0.7.0",
15
- "@gradio/checkbox": "^0.4.31",
16
- "@gradio/client": "^1.19.1",
17
16
  "@gradio/code": "^0.15.0",
18
- "@gradio/column": "^0.2.2",
17
+ "@gradio/client": "^1.19.1",
19
18
  "@gradio/colorpicker": "^0.4.29",
19
+ "@gradio/column": "^0.2.2",
20
20
  "@gradio/dataframe": "^0.20.1",
21
- "@gradio/dataset": "^0.4.34",
22
21
  "@gradio/datetime": "^0.3.22",
22
+ "@gradio/dataset": "^0.4.34",
23
+ "@gradio/dropdown": "^0.10.5",
23
24
  "@gradio/downloadbutton": "^0.4.12",
24
- "@gradio/fallback": "^0.4.29",
25
- "@gradio/file": "^0.13.0",
26
- "@gradio/dropdown": "^0.10.4",
27
25
  "@gradio/fileexplorer": "^0.5.41",
26
+ "@gradio/fallback": "^0.4.29",
28
27
  "@gradio/form": "^0.2.25",
28
+ "@gradio/file": "^0.13.0",
29
29
  "@gradio/gallery": "^0.15.34",
30
30
  "@gradio/group": "^0.2.1",
31
- "@gradio/icons": "^0.14.0",
32
31
  "@gradio/highlightedtext": "^0.9.13",
32
+ "@gradio/icons": "^0.14.0",
33
33
  "@gradio/html": "^0.7.2",
34
- "@gradio/image": "^0.23.1",
35
- "@gradio/imageeditor": "^0.17.1",
36
34
  "@gradio/imageslider": "^0.3.0",
35
+ "@gradio/image": "^0.23.1",
36
+ "@gradio/imageeditor": "^0.18.0",
37
37
  "@gradio/json": "^0.5.31",
38
- "@gradio/markdown": "^0.13.22",
39
- "@gradio/multimodaltextbox": "^0.10.20",
40
- "@gradio/model3d": "^0.15.0",
41
38
  "@gradio/label": "^0.5.21",
39
+ "@gradio/markdown": "^0.13.22",
40
+ "@gradio/multimodaltextbox": "^0.10.21",
42
41
  "@gradio/nativeplot": "^0.8.0",
43
- "@gradio/paramviewer": "^0.8.1",
42
+ "@gradio/model3d": "^0.15.0",
44
43
  "@gradio/number": "^0.7.1",
45
44
  "@gradio/plot": "^0.9.24",
46
45
  "@gradio/radio": "^0.7.12",
46
+ "@gradio/paramviewer": "^0.8.1",
47
47
  "@gradio/sidebar": "^0.1.23",
48
48
  "@gradio/row": "^0.2.2",
49
+ "@gradio/simpledropdown": "^0.3.29",
49
50
  "@gradio/simpleimage": "^0.9.0",
50
51
  "@gradio/simpletextbox": "^0.3.30",
51
- "@gradio/sketchbox": "^0.6.17",
52
- "@gradio/simpledropdown": "^0.3.29",
53
52
  "@gradio/slider": "^0.6.18",
53
+ "@gradio/sketchbox": "^0.6.17",
54
54
  "@gradio/state": "^0.1.2",
55
+ "@gradio/statustracker": "^0.11.1",
55
56
  "@gradio/tabitem": "^0.6.1",
56
- "@gradio/textbox": "^0.11.1",
57
57
  "@gradio/tabs": "^0.5.1",
58
- "@gradio/statustracker": "^0.11.1",
59
58
  "@gradio/timer": "^0.4.5",
60
- "@gradio/upload": "^0.17.1",
61
59
  "@gradio/theme": "^0.4.0",
60
+ "@gradio/upload": "^0.17.1",
61
+ "@gradio/textbox": "^0.11.1",
62
62
  "@gradio/uploadbutton": "^0.9.12",
63
- "@gradio/vibeeditor": "^0.3.0",
64
63
  "@gradio/utils": "^0.10.2",
65
- "@gradio/video": "^0.16.0"
64
+ "@gradio/video": "^0.16.0",
65
+ "@gradio/vibeeditor": "^0.3.0"
66
66
  },
67
67
  "msw": {
68
68
  "workerDirectory": "public"
package/src/init.ts CHANGED
@@ -938,11 +938,14 @@ function process_children_visibility(
938
938
  const visible_components: Set<number> = new Set();
939
939
 
940
940
  if (layout.children) {
941
+ const layout_component = components.find((c) => c.id === layout.id);
941
942
  for (const child of layout.children) {
942
943
  const child_visible = determine_visible_components(
943
944
  child,
944
945
  components,
945
- true,
946
+ layout_component?.type === "tabitem"
947
+ ? layout_component.props.children_visible !== false
948
+ : true,
946
949
  parent_tabs_context
947
950
  );
948
951
  child_visible.forEach((id) => visible_components.add(id));
@@ -998,8 +1001,14 @@ function determine_visible_components(
998
1001
  );
999
1002
  child_visible.forEach((id) => visible_components.add(id));
1000
1003
  } else if (component.type === "tabitem") {
1004
+ const tab_item_visible = is_tab_item_visible(
1005
+ component,
1006
+ component_visible,
1007
+ parent_tabs_context
1008
+ );
1001
1009
  if (
1002
- is_tab_item_visible(component, component_visible, parent_tabs_context)
1010
+ tab_item_visible ||
1011
+ (!tab_item_visible && component.props.render_children)
1003
1012
  ) {
1004
1013
  visible_components.add(layout.id);
1005
1014