@gradio/core 0.24.0 → 0.25.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,28 @@
1
1
  # @gradio/core
2
2
 
3
+ ## 0.25.0
4
+
5
+ ### Features
6
+
7
+ - [#11662](https://github.com/gradio-app/gradio/pull/11662) [`a78f5fa`](https://github.com/gradio-app/gradio/commit/a78f5fa466a4b11ffaaafc5099a64df49afb6e41) - Gradio vibe editor. Thanks @aliabid94!
8
+
9
+ ### Dependency updates
10
+
11
+ - @gradio/code@0.14.13
12
+ - @gradio/upload@0.16.13
13
+ - @gradio/video@0.14.23
14
+ - @gradio/client@1.16.0
15
+ - @gradio/image@0.22.15
16
+ - @gradio/button@0.5.9
17
+ - @gradio/gallery@0.15.29
18
+ - @gradio/file@0.12.26
19
+
20
+ ## 0.24.0
21
+
22
+ ### Dependency updates
23
+
24
+ - @gradio/dropdown@0.10.0
25
+
3
26
  ## 0.24.0
4
27
 
5
28
  ### Features
@@ -35,6 +35,7 @@ export let api_prefix = "";
35
35
  export let max_file_size = void 0;
36
36
  export let initial_layout = void 0;
37
37
  export let css = null;
38
+ export let vibe_mode = false;
38
39
  let broken_connection = false;
39
40
  let {
40
41
  layout: _layout,
@@ -63,6 +64,7 @@ $:
63
64
  handle_load_triggers();
64
65
  old_dependencies = dependencies;
65
66
  }
67
+ let vibe_editor_width = 350;
66
68
  async function run() {
67
69
  await setupi18n(app.config?.i18n_translations || void 0);
68
70
  layout_creating = true;
@@ -87,6 +89,7 @@ let allow_video_trim = true;
87
89
  let ApiDocs = null;
88
90
  let ApiRecorder = null;
89
91
  let Settings = null;
92
+ let VibeEditor = null;
90
93
  async function loadApiDocs() {
91
94
  if (!ApiDocs || !ApiRecorder) {
92
95
  const api_docs_module = await import("./api_docs/ApiDocs.svelte");
@@ -109,6 +112,12 @@ async function loadSettings() {
109
112
  Settings = settings_module.default;
110
113
  }
111
114
  }
115
+ async function loadVibeEditor() {
116
+ if (!VibeEditor) {
117
+ const vibe_editor_module = await import("@gradio/vibeeditor");
118
+ VibeEditor = vibe_editor_module.default;
119
+ }
120
+ }
112
121
  async function set_api_docs_visible(visible) {
113
122
  api_recorder_visible = false;
114
123
  if (visible) {
@@ -753,6 +762,13 @@ onMount(() => {
753
762
  $is_screen_recording = isRecording;
754
763
  }
755
764
  );
765
+ const handleVibeEditorResize = (event) => {
766
+ vibe_editor_width = event.detail.width;
767
+ };
768
+ window.addEventListener(
769
+ "vibeEditorResize",
770
+ handleVibeEditorResize
771
+ );
756
772
  if (api_docs_visible) {
757
773
  loadApiDocs();
758
774
  }
@@ -762,6 +778,9 @@ onMount(() => {
762
778
  if (settings_visible) {
763
779
  loadSettings();
764
780
  }
781
+ if (vibe_mode) {
782
+ loadVibeEditor();
783
+ }
765
784
  });
766
785
  function screen_recording() {
767
786
  if ($is_screen_recording) {
@@ -782,7 +801,11 @@ function screen_recording() {
782
801
  </svelte:head>
783
802
 
784
803
  <div class="wrap" style:min-height={app_mode ? "100%" : "auto"}>
785
- <div class="contain" style:flex-grow={app_mode ? "1" : "auto"}>
804
+ <div
805
+ class="contain"
806
+ style:flex-grow={app_mode ? "1" : "auto"}
807
+ style:margin-right={vibe_mode ? `${vibe_editor_width}px` : "0"}
808
+ >
786
809
  {#if $_layout && app.config}
787
810
  <MountComponents
788
811
  rootNode={$_layout}
@@ -938,6 +961,10 @@ function screen_recording() {
938
961
  <Toast {messages} on:close={handle_error_close} />
939
962
  {/if}
940
963
 
964
+ {#if vibe_mode && VibeEditor}
965
+ <svelte:component this={VibeEditor} {app} {root} />
966
+ {/if}
967
+
941
968
  <style>
942
969
  .wrap {
943
970
  display: flex;
@@ -28,6 +28,7 @@ declare const __propDef: {
28
28
  max_file_size?: number | undefined;
29
29
  initial_layout?: ComponentMeta | undefined;
30
30
  css?: string | null | undefined;
31
+ vibe_mode?: boolean | undefined;
31
32
  search_params: URLSearchParams;
32
33
  render_complete?: boolean | undefined;
33
34
  add_new_message?: ((title: string, message: string, type: ToastMessage["type"]) => void) | undefined;
package/package.json CHANGED
@@ -1,68 +1,69 @@
1
1
  {
2
2
  "name": "@gradio/core",
3
- "version": "0.24.0",
3
+ "version": "0.25.0",
4
4
  "type": "module",
5
5
  "devDependencies": {
6
6
  "@gradio/accordion": "^0.5.20",
7
- "@gradio/annotatedimage": "^0.9.26",
8
7
  "@gradio/atoms": "^0.16.3",
9
- "@gradio/audio": "^0.17.22",
10
- "@gradio/browserstate": "^0.3.2",
8
+ "@gradio/annotatedimage": "^0.9.27",
11
9
  "@gradio/box": "^0.2.21",
12
- "@gradio/button": "^0.5.8",
13
- "@gradio/checkbox": "^0.4.26",
10
+ "@gradio/browserstate": "^0.3.2",
11
+ "@gradio/audio": "^0.17.23",
12
+ "@gradio/chatbot": "^0.26.20",
13
+ "@gradio/button": "^0.5.9",
14
14
  "@gradio/checkboxgroup": "^0.6.25",
15
- "@gradio/chatbot": "^0.26.19",
16
- "@gradio/client": "^1.15.7",
17
- "@gradio/code": "^0.14.12",
15
+ "@gradio/checkbox": "^0.4.26",
16
+ "@gradio/client": "^1.16.0",
17
+ "@gradio/code": "^0.14.13",
18
18
  "@gradio/colorpicker": "^0.4.25",
19
19
  "@gradio/column": "^0.2.1",
20
- "@gradio/dataset": "^0.4.29",
21
- "@gradio/dataframe": "^0.18.4",
20
+ "@gradio/dataset": "^0.4.30",
21
+ "@gradio/dataframe": "^0.18.5",
22
+ "@gradio/downloadbutton": "^0.4.9",
22
23
  "@gradio/datetime": "^0.3.18",
23
- "@gradio/downloadbutton": "^0.4.8",
24
- "@gradio/dropdown": "^0.9.25",
24
+ "@gradio/dropdown": "^0.10.0",
25
+ "@gradio/file": "^0.12.26",
26
+ "@gradio/fileexplorer": "^0.5.37",
25
27
  "@gradio/fallback": "^0.4.25",
26
- "@gradio/file": "^0.12.25",
27
28
  "@gradio/form": "^0.2.21",
28
- "@gradio/fileexplorer": "^0.5.36",
29
- "@gradio/gallery": "^0.15.28",
29
+ "@gradio/gallery": "^0.15.29",
30
+ "@gradio/group": "^0.2.0",
30
31
  "@gradio/highlightedtext": "^0.9.8",
31
32
  "@gradio/html": "^0.6.17",
32
33
  "@gradio/icons": "^0.12.0",
33
- "@gradio/image": "^0.22.14",
34
- "@gradio/imageeditor": "^0.16.2",
35
- "@gradio/imageslider": "^0.2.10",
36
- "@gradio/json": "^0.5.27",
37
- "@gradio/group": "^0.2.0",
34
+ "@gradio/image": "^0.22.15",
35
+ "@gradio/imageeditor": "^0.16.3",
36
+ "@gradio/imageslider": "^0.2.11",
38
37
  "@gradio/label": "^0.5.17",
39
- "@gradio/model3d": "^0.14.22",
38
+ "@gradio/multimodaltextbox": "^0.10.15",
40
39
  "@gradio/markdown": "^0.13.18",
40
+ "@gradio/model3d": "^0.14.23",
41
+ "@gradio/json": "^0.5.27",
41
42
  "@gradio/nativeplot": "^0.7.2",
42
- "@gradio/multimodaltextbox": "^0.10.14",
43
43
  "@gradio/number": "^0.6.2",
44
44
  "@gradio/paramviewer": "^0.7.13",
45
- "@gradio/radio": "^0.7.8",
46
45
  "@gradio/plot": "^0.9.20",
46
+ "@gradio/radio": "^0.7.8",
47
47
  "@gradio/row": "^0.2.1",
48
48
  "@gradio/sidebar": "^0.1.18",
49
- "@gradio/simpledropdown": "^0.3.25",
50
- "@gradio/simpleimage": "^0.8.36",
49
+ "@gradio/simpleimage": "^0.8.37",
51
50
  "@gradio/simpletextbox": "^0.3.26",
51
+ "@gradio/simpledropdown": "^0.3.25",
52
52
  "@gradio/sketchbox": "^0.6.13",
53
- "@gradio/statustracker": "^0.10.15",
54
- "@gradio/state": "^0.1.2",
55
53
  "@gradio/slider": "^0.6.14",
54
+ "@gradio/state": "^0.1.2",
56
55
  "@gradio/tabitem": "^0.5.0",
57
56
  "@gradio/tabs": "^0.4.5",
57
+ "@gradio/statustracker": "^0.10.15",
58
58
  "@gradio/textbox": "^0.10.18",
59
- "@gradio/upload": "^0.16.12",
60
- "@gradio/timer": "^0.4.5",
61
- "@gradio/uploadbutton": "^0.9.8",
62
59
  "@gradio/theme": "^0.4.0",
60
+ "@gradio/timer": "^0.4.5",
63
61
  "@gradio/utils": "^0.10.2",
64
- "@gradio/wasm": "^0.18.1",
65
- "@gradio/video": "^0.14.22"
62
+ "@gradio/vibeeditor": "^0.2.0",
63
+ "@gradio/uploadbutton": "^0.9.9",
64
+ "@gradio/video": "^0.14.23",
65
+ "@gradio/upload": "^0.16.13",
66
+ "@gradio/wasm": "^0.18.1"
66
67
  },
67
68
  "msw": {
68
69
  "workerDirectory": "public"
package/src/Blocks.svelte CHANGED
@@ -56,6 +56,7 @@
56
56
  export let max_file_size: number | undefined = undefined;
57
57
  export let initial_layout: ComponentMeta | undefined = undefined;
58
58
  export let css: string | null | undefined = null;
59
+ export let vibe_mode = false;
59
60
  let broken_connection = false;
60
61
 
61
62
  let {
@@ -92,6 +93,8 @@
92
93
  old_dependencies = dependencies;
93
94
  }
94
95
 
96
+ let vibe_editor_width = 350;
97
+
95
98
  async function run(): Promise<void> {
96
99
  await setupi18n(app.config?.i18n_translations || undefined);
97
100
 
@@ -121,6 +124,7 @@
121
124
  let ApiDocs: ComponentType<ApiDocs> | null = null;
122
125
  let ApiRecorder: ComponentType<ApiRecorder> | null = null;
123
126
  let Settings: ComponentType<Settings> | null = null;
127
+ let VibeEditor: ComponentType | null = null;
124
128
 
125
129
  async function loadApiDocs(): Promise<void> {
126
130
  if (!ApiDocs || !ApiRecorder) {
@@ -145,6 +149,13 @@
145
149
  }
146
150
  }
147
151
 
152
+ async function loadVibeEditor(): Promise<void> {
153
+ if (!VibeEditor) {
154
+ const vibe_editor_module = await import("@gradio/vibeeditor");
155
+ VibeEditor = vibe_editor_module.default;
156
+ }
157
+ }
158
+
148
159
  async function set_api_docs_visible(visible: boolean): Promise<void> {
149
160
  api_recorder_visible = false;
150
161
  if (visible) {
@@ -945,6 +956,15 @@
945
956
  }
946
957
  );
947
958
 
959
+ const handleVibeEditorResize = (event: CustomEvent): void => {
960
+ vibe_editor_width = event.detail.width;
961
+ };
962
+
963
+ window.addEventListener(
964
+ "vibeEditorResize",
965
+ handleVibeEditorResize as EventListener
966
+ );
967
+
948
968
  // Load components if they should be visible on initial page load
949
969
  if (api_docs_visible) {
950
970
  loadApiDocs();
@@ -955,6 +975,9 @@
955
975
  if (settings_visible) {
956
976
  loadSettings();
957
977
  }
978
+ if (vibe_mode) {
979
+ loadVibeEditor();
980
+ }
958
981
  });
959
982
 
960
983
  function screen_recording(): void {
@@ -976,7 +999,11 @@
976
999
  </svelte:head>
977
1000
 
978
1001
  <div class="wrap" style:min-height={app_mode ? "100%" : "auto"}>
979
- <div class="contain" style:flex-grow={app_mode ? "1" : "auto"}>
1002
+ <div
1003
+ class="contain"
1004
+ style:flex-grow={app_mode ? "1" : "auto"}
1005
+ style:margin-right={vibe_mode ? `${vibe_editor_width}px` : "0"}
1006
+ >
980
1007
  {#if $_layout && app.config}
981
1008
  <MountComponents
982
1009
  rootNode={$_layout}
@@ -1132,6 +1159,10 @@
1132
1159
  <Toast {messages} on:close={handle_error_close} />
1133
1160
  {/if}
1134
1161
 
1162
+ {#if vibe_mode && VibeEditor}
1163
+ <svelte:component this={VibeEditor} {app} {root} />
1164
+ {/if}
1165
+
1135
1166
  <style>
1136
1167
  .wrap {
1137
1168
  display: flex;