@gradio/video 0.1.2 → 0.1.3

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/video
2
2
 
3
+ ## 0.1.3
4
+
5
+ ### Fixes
6
+
7
+ - [#6279](https://github.com/gradio-app/gradio/pull/6279) [`3cdeabc68`](https://github.com/gradio-app/gradio/commit/3cdeabc6843000310e1a9e1d17190ecbf3bbc780) - Ensure source selection does not get hidden in overflow. Thanks [@hannahblair](https://github.com/hannahblair)!
8
+
3
9
  ## 0.1.2
4
10
 
5
11
  ### Fixes
@@ -1,6 +1,8 @@
1
1
  <script>
2
2
  import { Meta, Template, Story } from "@storybook/addon-svelte-csf";
3
3
  import Video from "./Index.svelte";
4
+ import { format } from "svelte-i18n";
5
+ import { get } from "svelte/store";
4
6
  </script>
5
7
 
6
8
  <Meta
@@ -22,9 +24,11 @@
22
24
  }}
23
25
  />
24
26
 
25
- <Template let:args>
26
- <Video {...args} />
27
- </Template>
27
+ <div>
28
+ <Template let:args>
29
+ <Video {...args} i18n={get(format)} />
30
+ </Template>
31
+ </div>
28
32
 
29
33
  <Story
30
34
  name="Record from webcam"
@@ -55,3 +59,16 @@
55
59
  width: 400
56
60
  }}
57
61
  />
62
+
63
+ <Story
64
+ name="Upload video"
65
+ args={{
66
+ label: "world video",
67
+ show_label: true,
68
+ interactive: true,
69
+ sources: ["upload", "webcam"],
70
+ width: 400,
71
+ height: 400,
72
+ value: null
73
+ }}
74
+ />
package/package.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "@gradio/video",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Gradio UI packages",
5
5
  "type": "module",
6
6
  "author": "",
7
7
  "license": "ISC",
8
8
  "private": false,
9
9
  "dependencies": {
10
- "@gradio/atoms": "^0.2.0",
11
- "@gradio/client": "^0.7.1",
10
+ "@gradio/atoms": "^0.2.1",
11
+ "@gradio/client": "^0.7.2",
12
12
  "@gradio/icons": "^0.2.0",
13
- "@gradio/image": "^0.3.2",
14
- "@gradio/statustracker": "^0.3.0",
15
- "@gradio/upload": "^0.3.2",
13
+ "@gradio/image": "^0.3.3",
14
+ "@gradio/statustracker": "^0.3.1",
15
+ "@gradio/upload": "^0.3.3",
16
16
  "@gradio/utils": "^0.2.0",
17
17
  "@gradio/wasm": "^0.2.0"
18
18
  },
@@ -4,11 +4,12 @@
4
4
  import type { FileData } from "@gradio/client";
5
5
  import { BlockLabel } from "@gradio/atoms";
6
6
  import { Webcam } from "@gradio/image";
7
- import { Video, Upload as UploadIcon } from "@gradio/icons";
7
+ import { Video } from "@gradio/icons";
8
8
 
9
9
  import { prettyBytes, playable } from "./utils";
10
10
  import Player from "./Player.svelte";
11
11
  import type { I18nFormatter } from "@gradio/utils";
12
+ import { SelectSource } from "@gradio/atoms";
12
13
 
13
14
  export let value: FileData | null = null;
14
15
  export let subtitle: FileData | null = null;
@@ -69,6 +70,7 @@
69
70
  on:load={handle_load}
70
71
  on:error={({ detail }) => dispatch("error", detail)}
71
72
  {root}
73
+ include_sources={sources.length > 1}
72
74
  >
73
75
  <slot />
74
76
  </Upload>
@@ -112,26 +114,7 @@
112
114
  {/if}
113
115
  {/if}
114
116
 
115
- {#if sources.length > 1}
116
- <span class="source-selection">
117
- <button
118
- class="icon"
119
- aria-label="Upload video"
120
- on:click={() => {
121
- handle_clear();
122
- active_source = "upload";
123
- }}><UploadIcon /></button
124
- >
125
- <button
126
- class="icon"
127
- aria-label="Record video"
128
- on:click={() => {
129
- handle_clear();
130
- active_source = "webcam";
131
- }}><Video /></button
132
- >
133
- </span>
134
- {/if}
117
+ <SelectSource {sources} bind:active_source {handle_clear} />
135
118
 
136
119
  <style>
137
120
  .file-name {
@@ -144,27 +127,4 @@
144
127
  padding: var(--size-2);
145
128
  font-size: var(--text-xl);
146
129
  }
147
-
148
- .source-selection {
149
- display: flex;
150
- align-items: center;
151
- justify-content: center;
152
- border-top: 1px solid var(--border-color-primary);
153
- width: 95%;
154
- margin: 0 auto;
155
- }
156
-
157
- .icon {
158
- width: 22px;
159
- height: 22px;
160
- margin: var(--spacing-lg) var(--spacing-xs);
161
- padding: var(--spacing-xs);
162
- color: var(--neutral-400);
163
- border-radius: var(--radius-md);
164
- }
165
-
166
- .icon:hover,
167
- .icon:focus {
168
- color: var(--color-accent);
169
- }
170
130
  </style>