From 03a11fcd3c91050c9e0a1555e9df4963ddf60172 Mon Sep 17 00:00:00 2001 From: Freddy Boulton Date: Wed, 29 Mar 2023 19:30:00 -0400 Subject: [PATCH] Add download button for video (#3581) * Add download buttom * Add missing imports * CHANGELOG * Update CHANGELOG.md * Trigger CI * Fix visibility * Try to fix ci * Fix deps * download button change * Lint --------- Co-authored-by: Dawood Co-authored-by: Abubakar Abid --- CHANGELOG.md | 7 + js/app/src/components/File/File.test.ts | 2 +- js/app/vite.config.js | 3 +- js/atoms/src/IconButton.svelte | 3 +- js/video/src/Player.svelte | 2 +- js/video/src/StaticVideo.svelte | 21 +- js/video/src/StaticVideo.test.ts | 35 +++ package.json | 1 + pnpm-lock.yaml | 296 +++++++++++++++--------- tsconfig.json | 1 + 10 files changed, 259 insertions(+), 112 deletions(-) create mode 100644 js/video/src/StaticVideo.test.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index d75a60b1ac..f5c1cb7f48 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,15 @@ ## New Features: +### Added a download button for videos! 📥 + +![download_video](https://user-images.githubusercontent.com/41651716/227009612-9bc5fb72-2a44-4c55-9b7b-a0fa098e7f25.gif) + +By [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3581](https://github.com/gradio-app/gradio/pull/3581). + - Trigger the release event when Slider number input is released or unfocused by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3589](https://github.com/gradio-app/gradio/pull/3589) + ## Bug Fixes: - Fixed bug where text for altair plots was not legible in dark mode by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3555](https://github.com/gradio-app/gradio/pull/3555) diff --git a/js/app/src/components/File/File.test.ts b/js/app/src/components/File/File.test.ts index c6be793cf9..3672a885c4 100644 --- a/js/app/src/components/File/File.test.ts +++ b/js/app/src/components/File/File.test.ts @@ -1,4 +1,4 @@ -import { test, describe, assert, expect, afterEach, vi } from "vitest"; +import { test, describe, expect, afterEach, vi } from "vitest"; import { cleanup, render } from "@gradio/tootils"; import File from "./File.svelte"; diff --git a/js/app/vite.config.js b/js/app/vite.config.js index b01a8b1605..0662a47a65 100644 --- a/js/app/vite.config.js +++ b/js/app/vite.config.js @@ -117,7 +117,8 @@ export default defineConfig(({ mode }) => { ], test: { environment: "happy-dom", - include: ["**/*.test.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"] + include: ["**/*.test.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"], + globals: true } }; }); diff --git a/js/atoms/src/IconButton.svelte b/js/atoms/src/IconButton.svelte index d57d6fc99a..856fb8f040 100644 --- a/js/atoms/src/IconButton.svelte +++ b/js/atoms/src/IconButton.svelte @@ -23,7 +23,8 @@ } button:hover { - border: 1px solid var(--button-secondary-border-color-hover); + cursor: pointer; + border: 2px solid var(--button-secondary-border-color-hover); color: var(--block-label-text-color); } diff --git a/js/video/src/Player.svelte b/js/video/src/Player.svelte index 95623e494e..85485840d1 100644 --- a/js/video/src/Player.svelte +++ b/js/video/src/Player.svelte @@ -1,5 +1,5 @@