@gradio/video 0.7.0 → 0.8.1

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,41 @@
1
1
  # @gradio/video
2
2
 
3
+ ## 0.8.1
4
+
5
+ ### Fixes
6
+
7
+ - [#8252](https://github.com/gradio-app/gradio/pull/8252) [`22df61a`](https://github.com/gradio-app/gradio/commit/22df61a26adf8023f6dd49c051979990e8d3879a) - Client node fix. Thanks @pngwn!
8
+
9
+ ### Dependency updates
10
+
11
+ - @gradio/atoms@0.7.3
12
+ - @gradio/statustracker@0.5.2
13
+ - @gradio/client@0.19.0
14
+ - @gradio/icons@0.4.1
15
+ - @gradio/image@0.11.1
16
+ - @gradio/upload@0.10.1
17
+
18
+ ## 0.8.0
19
+
20
+ ### Features
21
+
22
+ - [#8121](https://github.com/gradio-app/gradio/pull/8121) [`f5b710c`](https://github.com/gradio-app/gradio/commit/f5b710c919b0ce604ea955f0d5f4faa91095ca4a) - chore(deps): update dependency eslint to v9. Thanks @renovate!
23
+ - [#8209](https://github.com/gradio-app/gradio/pull/8209) [`b9afe93`](https://github.com/gradio-app/gradio/commit/b9afe93915401df5bd6737c89395c2477acfa585) - Rename `eventSource_Factory` and `fetch_implementation`. Thanks @hannahblair!
24
+
25
+ ### Fixes
26
+
27
+ - [#8179](https://github.com/gradio-app/gradio/pull/8179) [`6a218b4`](https://github.com/gradio-app/gradio/commit/6a218b4148095aaa0c58d8c20973ba01c8764fc2) - rework upload to be a class method + pass client into each component. Thanks @pngwn!
28
+
29
+ ### Dependency updates
30
+
31
+ - @gradio/atoms@0.7.2
32
+ - @gradio/client@0.18.0
33
+ - @gradio/upload@0.10.0
34
+ - @gradio/utils@0.4.1
35
+ - @gradio/wasm@0.10.1
36
+ - @gradio/statustracker@0.5.1
37
+ - @gradio/image@0.11.0
38
+
3
39
  ## 0.7.0
4
40
 
5
41
  ### Highlights
package/Index.svelte CHANGED
@@ -156,6 +156,7 @@
156
156
  on:share={({ detail }) => gradio.dispatch("share", detail)}
157
157
  on:error={({ detail }) => gradio.dispatch("error", detail)}
158
158
  i18n={gradio.i18n}
159
+ upload={gradio.client.upload}
159
160
  />
160
161
  </Block>
161
162
  {:else}
@@ -206,6 +207,8 @@
206
207
  on:stop_recording={() => gradio.dispatch("stop_recording")}
207
208
  i18n={gradio.i18n}
208
209
  max_file_size={gradio.max_file_size}
210
+ upload={gradio.client.upload}
211
+ stream_handler={gradio.client.stream}
209
212
  >
210
213
  <UploadText i18n={gradio.i18n} type="video" />
211
214
  </Video>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gradio/video",
3
- "version": "0.7.0",
3
+ "version": "0.8.1",
4
4
  "description": "Gradio UI packages",
5
5
  "type": "module",
6
6
  "author": "",
@@ -10,17 +10,17 @@
10
10
  "@ffmpeg/ffmpeg": "^0.12.7",
11
11
  "@ffmpeg/util": "^0.12.1",
12
12
  "mrmime": "^2.0.0",
13
- "@gradio/client": "^0.17.0",
14
- "@gradio/atoms": "^0.7.1",
15
- "@gradio/icons": "^0.4.0",
16
- "@gradio/image": "^0.10.0",
17
- "@gradio/statustracker": "^0.5.0",
18
- "@gradio/upload": "^0.9.0",
19
- "@gradio/utils": "^0.4.0",
20
- "@gradio/wasm": "^0.10.0"
13
+ "@gradio/atoms": "^0.7.3",
14
+ "@gradio/client": "^0.19.0",
15
+ "@gradio/image": "^0.11.1",
16
+ "@gradio/wasm": "^0.10.1",
17
+ "@gradio/statustracker": "^0.5.2",
18
+ "@gradio/icons": "^0.4.1",
19
+ "@gradio/utils": "^0.4.1",
20
+ "@gradio/upload": "^0.10.1"
21
21
  },
22
22
  "devDependencies": {
23
- "@gradio/preview": "^0.8.0"
23
+ "@gradio/preview": "^0.9.0"
24
24
  },
25
25
  "exports": {
26
26
  ".": "./index.ts",
@@ -1,7 +1,7 @@
1
1
  <script lang="ts">
2
2
  import { createEventDispatcher } from "svelte";
3
3
  import { Upload, ModifyUpload } from "@gradio/upload";
4
- import type { FileData } from "@gradio/client";
4
+ import type { FileData, Client } from "@gradio/client";
5
5
  import { BlockLabel } from "@gradio/atoms";
6
6
  import { Webcam } from "@gradio/image";
7
7
  import { Video } from "@gradio/icons";
@@ -29,6 +29,8 @@
29
29
  export let active_source: "webcam" | "upload" = "webcam";
30
30
  export let handle_reset_value: () => void = () => {};
31
31
  export let max_file_size: number | null = null;
32
+ export let upload: Client["upload"];
33
+ export let stream_handler: Client["stream"];
32
34
 
33
35
  const dispatch = createEventDispatcher<{
34
36
  change: FileData | null;
@@ -81,6 +83,8 @@
81
83
  {max_file_size}
82
84
  on:error={({ detail }) => dispatch("error", detail)}
83
85
  {root}
86
+ {upload}
87
+ {stream_handler}
84
88
  >
85
89
  <slot />
86
90
  </Upload>
@@ -95,6 +99,7 @@
95
99
  on:start_recording
96
100
  on:stop_recording
97
101
  {i18n}
102
+ {upload}
98
103
  />
99
104
  {/if}
100
105
  </div>
@@ -107,6 +112,7 @@
107
112
  {#if playable()}
108
113
  {#key value?.url}
109
114
  <Player
115
+ {upload}
110
116
  {root}
111
117
  interactive
112
118
  {autoplay}
@@ -3,8 +3,8 @@
3
3
  import { Play, Pause, Maximise, Undo } from "@gradio/icons";
4
4
  import Video from "./Video.svelte";
5
5
  import VideoControls from "./VideoControls.svelte";
6
- import type { FileData } from "@gradio/client";
7
- import { prepare_files, upload } from "@gradio/client";
6
+ import type { FileData, Client } from "@gradio/client";
7
+ import { prepare_files } from "@gradio/client";
8
8
  import { format_time } from "@gradio/utils";
9
9
 
10
10
  export let root = "";
@@ -16,6 +16,7 @@
16
16
  export let interactive = false;
17
17
  export let handle_change: (video: FileData) => void = () => {};
18
18
  export let handle_reset_value: () => void = () => {};
19
+ export let upload: Client["upload"];
19
20
 
20
21
  const dispatch = createEventDispatcher<{
21
22
  play: undefined;
@@ -1,7 +1,7 @@
1
1
  <script lang="ts">
2
2
  import { createEventDispatcher, afterUpdate, tick } from "svelte";
3
3
  import { BlockLabel, Empty, IconButton, ShareButton } from "@gradio/atoms";
4
- import type { FileData } from "@gradio/client";
4
+ import type { FileData, Client } from "@gradio/client";
5
5
  import { Video, Download } from "@gradio/icons";
6
6
  import { uploadToHuggingFace } from "@gradio/utils";
7
7
  import { DownloadLink } from "@gradio/wasm/svelte";
@@ -17,6 +17,7 @@
17
17
  export let show_share_button = true;
18
18
  export let show_download_button = true;
19
19
  export let i18n: I18nFormatter;
20
+ export let upload: Client["upload"];
20
21
 
21
22
  let old_value: FileData | null = null;
22
23
  let old_subtitle: FileData | null = null;
@@ -64,6 +65,7 @@
64
65
  mirror={false}
65
66
  {label}
66
67
  interactive={false}
68
+ {upload}
67
69
  />
68
70
  {/key}
69
71
  <div class="icon-buttons" data-testid="download-div">
@@ -9,7 +9,7 @@
9
9
 
10
10
  let thumbnails: string[] = [];
11
11
  let numberOfThumbnails = 10;
12
- let intervalId: number | NodeJS.Timer;
12
+ let intervalId: ReturnType<typeof setInterval> | undefined;
13
13
  let videoDuration: number;
14
14
 
15
15
  let leftHandlePosition = 0;
@@ -136,7 +136,7 @@
136
136
  window.removeEventListener("mouseup", stopDragging);
137
137
  window.removeEventListener("keydown", moveHandle);
138
138
 
139
- if (intervalId) {
139
+ if (intervalId !== undefined) {
140
140
  clearInterval(intervalId);
141
141
  }
142
142
  });