@gradio/core 0.29.0 → 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,36 @@
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
+
9
+ ## 0.29.1
10
+
11
+ ### Fixes
12
+
13
+ - [#11992](https://github.com/gradio-app/gradio/pull/11992) [`1ae2a57`](https://github.com/gradio-app/gradio/commit/1ae2a57a253c56cd8f3d3e5d795688fec80cab2c) - fix iframe sizing on spaces for apps runing in SPA mode. Thanks @pngwn!
14
+ - [#11993](https://github.com/gradio-app/gradio/pull/11993) [`0dc0be8`](https://github.com/gradio-app/gradio/commit/0dc0be8ff1526d43ba7b01ccc7d8173f92c5eed2) - Trigger Change Event if component is in inactive tab. Thanks @freddyaboulton!
15
+
16
+ ### Dependency updates
17
+
18
+ - @gradio/client@1.19.1
19
+
20
+ ## 0.29.0
21
+
22
+ ### Dependency updates
23
+
24
+ - @gradio/image@0.23.1
25
+ - @gradio/upload@0.17.1
26
+ - @gradio/atoms@0.18.1
27
+
28
+ ## 0.29.0
29
+
30
+ ### Dependency updates
31
+
32
+ - @gradio/paramviewer@0.8.1
33
+
3
34
  ## 0.29.0
4
35
 
5
36
  ### Features
@@ -683,7 +683,11 @@ async function handle_mount() {
683
683
  const { id, prop, value } = e.detail;
684
684
  if (prop === "value") {
685
685
  update_value([
686
- { id, prop: "loading_status", value: { validation_error: void 0 } }
686
+ {
687
+ id,
688
+ prop: "loading_status",
689
+ value: { validation_error: void 0 }
690
+ }
687
691
  ]);
688
692
  }
689
693
  update_value([{ id, prop, value }]);
@@ -832,14 +836,13 @@ function screen_recording() {
832
836
  }
833
837
  let footer_height = 0;
834
838
  let root_container;
835
- $: root_node = $_layout && get_root_node(root_container);
836
839
  function get_root_node(container) {
837
840
  if (!container) return null;
838
841
  return container.children[container.children.length - 1];
839
842
  }
840
843
  function handle_resize() {
841
844
  if ("parentIFrame" in window) {
842
- const box = root_node?.getBoundingClientRect();
845
+ const box = root_container.children[0].getBoundingClientRect();
843
846
  if (!box) return;
844
847
  window.parentIFrame?.size(box.bottom + footer_height + 32);
845
848
  }
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));
@@ -722,6 +727,9 @@ function is_visible(component) {
722
727
  return false;
723
728
  }
724
729
  else if (component.parent) {
730
+ if (component.parent.type === "tabitem") {
731
+ return is_tab_item_visible(component.parent, is_visible(component.parent));
732
+ }
725
733
  return is_visible(component.parent);
726
734
  }
727
735
  return true;
package/package.json CHANGED
@@ -1,68 +1,68 @@
1
1
  {
2
2
  "name": "@gradio/core",
3
- "version": "0.29.0",
3
+ "version": "0.29.2",
4
4
  "type": "module",
5
5
  "devDependencies": {
6
- "@gradio/annotatedimage": "^0.10.0",
7
6
  "@gradio/accordion": "^0.5.24",
8
- "@gradio/atoms": "^0.18.0",
9
- "@gradio/box": "^0.2.25",
10
- "@gradio/browserstate": "^0.3.2",
11
- "@gradio/audio": "^0.19.0",
7
+ "@gradio/annotatedimage": "^0.10.0",
8
+ "@gradio/atoms": "^0.18.1",
9
+ "@gradio/audio": "^0.19.2",
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/checkbox": "^0.4.30",
14
+ "@gradio/browserstate": "^0.3.2",
15
15
  "@gradio/checkboxgroup": "^0.7.0",
16
16
  "@gradio/code": "^0.15.0",
17
+ "@gradio/client": "^1.19.1",
17
18
  "@gradio/colorpicker": "^0.4.29",
18
- "@gradio/client": "^1.19.0",
19
19
  "@gradio/column": "^0.2.2",
20
+ "@gradio/dataframe": "^0.20.1",
21
+ "@gradio/datetime": "^0.3.22",
20
22
  "@gradio/dataset": "^0.4.34",
23
+ "@gradio/dropdown": "^0.10.5",
21
24
  "@gradio/downloadbutton": "^0.4.12",
22
- "@gradio/dataframe": "^0.19.3",
23
- "@gradio/datetime": "^0.3.22",
24
- "@gradio/fallback": "^0.4.29",
25
- "@gradio/dropdown": "^0.10.4",
26
- "@gradio/file": "^0.13.0",
27
25
  "@gradio/fileexplorer": "^0.5.41",
26
+ "@gradio/fallback": "^0.4.29",
28
27
  "@gradio/form": "^0.2.25",
29
- "@gradio/gallery": "^0.15.33",
30
- "@gradio/highlightedtext": "^0.9.12",
28
+ "@gradio/file": "^0.13.0",
29
+ "@gradio/gallery": "^0.15.34",
31
30
  "@gradio/group": "^0.2.1",
32
- "@gradio/html": "^0.7.2",
33
- "@gradio/image": "^0.23.0",
31
+ "@gradio/highlightedtext": "^0.9.13",
34
32
  "@gradio/icons": "^0.14.0",
33
+ "@gradio/html": "^0.7.2",
35
34
  "@gradio/imageslider": "^0.3.0",
36
- "@gradio/imageeditor": "^0.17.0",
37
- "@gradio/label": "^0.5.21",
35
+ "@gradio/image": "^0.23.1",
36
+ "@gradio/imageeditor": "^0.18.0",
38
37
  "@gradio/json": "^0.5.31",
38
+ "@gradio/label": "^0.5.21",
39
39
  "@gradio/markdown": "^0.13.22",
40
+ "@gradio/multimodaltextbox": "^0.10.21",
41
+ "@gradio/nativeplot": "^0.8.0",
40
42
  "@gradio/model3d": "^0.15.0",
41
- "@gradio/multimodaltextbox": "^0.10.19",
42
- "@gradio/paramviewer": "^0.8.0",
43
43
  "@gradio/number": "^0.7.1",
44
- "@gradio/nativeplot": "^0.7.6",
45
44
  "@gradio/plot": "^0.9.24",
46
45
  "@gradio/radio": "^0.7.12",
46
+ "@gradio/paramviewer": "^0.8.1",
47
+ "@gradio/sidebar": "^0.1.23",
48
+ "@gradio/row": "^0.2.2",
47
49
  "@gradio/simpledropdown": "^0.3.29",
48
- "@gradio/sidebar": "^0.1.22",
49
50
  "@gradio/simpleimage": "^0.9.0",
50
- "@gradio/row": "^0.2.2",
51
51
  "@gradio/simpletextbox": "^0.3.30",
52
52
  "@gradio/slider": "^0.6.18",
53
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
57
  "@gradio/tabs": "^0.5.1",
57
- "@gradio/statustracker": "^0.11.1",
58
- "@gradio/textbox": "^0.11.1",
59
- "@gradio/theme": "^0.4.0",
60
58
  "@gradio/timer": "^0.4.5",
61
- "@gradio/upload": "^0.17.0",
62
- "@gradio/vibeeditor": "^0.2.4",
59
+ "@gradio/theme": "^0.4.0",
60
+ "@gradio/upload": "^0.17.1",
61
+ "@gradio/textbox": "^0.11.1",
63
62
  "@gradio/uploadbutton": "^0.9.12",
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/Blocks.svelte CHANGED
@@ -876,7 +876,11 @@
876
876
  const { id, prop, value } = e.detail;
877
877
  if (prop === "value") {
878
878
  update_value([
879
- { id, prop: "loading_status", value: { validation_error: undefined } }
879
+ {
880
+ id,
881
+ prop: "loading_status",
882
+ value: { validation_error: undefined }
883
+ }
880
884
  ]);
881
885
  }
882
886
  update_value([{ id, prop, value }]);
@@ -1059,7 +1063,6 @@
1059
1063
  let footer_height = 0;
1060
1064
 
1061
1065
  let root_container: HTMLElement;
1062
- $: root_node = $_layout && get_root_node(root_container);
1063
1066
 
1064
1067
  function get_root_node(container: HTMLElement | null): HTMLElement | null {
1065
1068
  if (!container) return null;
@@ -1068,7 +1071,7 @@
1068
1071
 
1069
1072
  function handle_resize(): void {
1070
1073
  if ("parentIFrame" in window) {
1071
- const box = root_node?.getBoundingClientRect();
1074
+ const box = root_container.children[0].getBoundingClientRect();
1072
1075
  if (!box) return;
1073
1076
  window.parentIFrame?.size(box.bottom + footer_height + 32);
1074
1077
  }
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
 
@@ -1107,6 +1116,12 @@ function is_visible(component: ComponentMeta): boolean {
1107
1116
  ) {
1108
1117
  return false;
1109
1118
  } else if (component.parent) {
1119
+ if (component.parent.type === "tabitem") {
1120
+ return is_tab_item_visible(
1121
+ component.parent,
1122
+ is_visible(component.parent)
1123
+ );
1124
+ }
1110
1125
  return is_visible(component.parent);
1111
1126
  }
1112
1127
  return true;
@@ -1,11 +0,0 @@
1
- import type { StoryObj } from "@storybook/svelte";
2
- import I18nMultiLanguageTestComponent from "./I18nMultiLanguageTestComponent.svelte";
3
- declare const meta: {
4
- component: typeof I18nMultiLanguageTestComponent;
5
- parameters: {
6
- layout: string;
7
- };
8
- };
9
- export default meta;
10
- type Story = StoryObj<typeof meta>;
11
- export declare const Default: Story;