gradio/js
Hannah ba6322ec2b
Fix image height content fit (#9116)
* fix image height content fit

* add changeset

* use `scale-down` instead of `contain`

* add changeset

* fix spacing

* apply image uploader styling to image preview

* Fix image/shared/ImagePreview style

* Fix

* Remove unnecessary styles from .image-frame

* Revert prev for the fullscreen mode

* Add stories

* fix python test

* move story files, fix python tests

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Yuichiro Tachibana (Tsuchiya) <t.yic.yt@gmail.com>
2024-08-21 18:41:40 +01:00
..
_cdn-test chore(deps): update dependency iframe-resizer to v5 (#8347) 2024-05-22 11:06:07 +01:00
_spaces-test chore: update versions (#8960) 2024-08-08 11:20:08 +01:00
_website Better text styling on docs (#9108) 2024-08-14 11:51:50 -07:00
accordion setup npm-previews of all packages (#9118) 2024-08-15 12:56:17 +01:00
annotatedimage setup npm-previews of all packages (#9118) 2024-08-15 12:56:17 +01:00
app fix version + pkg name (#9110) 2024-08-14 15:43:01 +01:00
atoms Add placeholder param to Image and ImageEditor to replace upload image text (#8930) 2024-08-21 01:22:17 +02:00
audio setup npm-previews of all packages (#9118) 2024-08-15 12:56:17 +01:00
box setup npm-previews of all packages (#9118) 2024-08-15 12:56:17 +01:00
build setup npm-previews of all packages (#9118) 2024-08-15 12:56:17 +01:00
button setup npm-previews of all packages (#9118) 2024-08-15 12:56:17 +01:00
chatbot setup npm-previews of all packages (#9118) 2024-08-15 12:56:17 +01:00
checkbox setup npm-previews of all packages (#9118) 2024-08-15 12:56:17 +01:00
checkboxgroup setup npm-previews of all packages (#9118) 2024-08-15 12:56:17 +01:00
code setup npm-previews of all packages (#9118) 2024-08-15 12:56:17 +01:00
colorpicker setup npm-previews of all packages (#9118) 2024-08-15 12:56:17 +01:00
column setup npm-previews of all packages (#9118) 2024-08-15 12:56:17 +01:00
component-test Create test app for components / SSR testing. (#9138) 2024-08-19 11:00:03 +01:00
core setup npm-previews of all packages (#9118) 2024-08-15 12:56:17 +01:00
dataframe Allow accessing the entire row of selected values in gr.DataFrame (#9128) 2024-08-20 21:08:29 +00:00
dataset setup npm-previews of all packages (#9118) 2024-08-15 12:56:17 +01:00
datetime setup npm-previews of all packages (#9118) 2024-08-15 12:56:17 +01:00
downloadbutton setup npm-previews of all packages (#9118) 2024-08-15 12:56:17 +01:00
dropdown Add placeholder param to Image and ImageEditor to replace upload image text (#8930) 2024-08-21 01:22:17 +02:00
fallback setup npm-previews of all packages (#9118) 2024-08-15 12:56:17 +01:00
file setup npm-previews of all packages (#9118) 2024-08-15 12:56:17 +01:00
fileexplorer setup npm-previews of all packages (#9118) 2024-08-15 12:56:17 +01:00
form setup npm-previews of all packages (#9118) 2024-08-15 12:56:17 +01:00
gallery setup npm-previews of all packages (#9118) 2024-08-15 12:56:17 +01:00
group setup npm-previews of all packages (#9118) 2024-08-15 12:56:17 +01:00
highlightedtext setup npm-previews of all packages (#9118) 2024-08-15 12:56:17 +01:00
html setup npm-previews of all packages (#9118) 2024-08-15 12:56:17 +01:00
icons setup npm-previews of all packages (#9118) 2024-08-15 12:56:17 +01:00
image Fix image height content fit (#9116) 2024-08-21 18:41:40 +01:00
imageeditor Add placeholder param to Image and ImageEditor to replace upload image text (#8930) 2024-08-21 01:22:17 +02:00
json setup npm-previews of all packages (#9118) 2024-08-15 12:56:17 +01:00
label setup npm-previews of all packages (#9118) 2024-08-15 12:56:17 +01:00
lite Initial SSR refactor (#9102) 2024-08-14 15:17:36 +01:00
markdown setup npm-previews of all packages (#9118) 2024-08-15 12:56:17 +01:00
model3D setup npm-previews of all packages (#9118) 2024-08-15 12:56:17 +01:00
multimodaltextbox Allow drag and replace image in gr.Image and Multimodal textbox (#9031) 2024-08-19 15:46:54 +01:00
nativeplot setup npm-previews of all packages (#9118) 2024-08-15 12:56:17 +01:00
number setup npm-previews of all packages (#9118) 2024-08-15 12:56:17 +01:00
paramviewer setup npm-previews of all packages (#9118) 2024-08-15 12:56:17 +01:00
plot setup npm-previews of all packages (#9118) 2024-08-15 12:56:17 +01:00
preview setup npm-previews of all packages (#9118) 2024-08-15 12:56:17 +01:00
radio setup npm-previews of all packages (#9118) 2024-08-15 12:56:17 +01:00
row setup npm-previews of all packages (#9118) 2024-08-15 12:56:17 +01:00
simpledropdown setup npm-previews of all packages (#9118) 2024-08-15 12:56:17 +01:00
simpleimage Fix image height content fit (#9116) 2024-08-21 18:41:40 +01:00
simpletextbox setup npm-previews of all packages (#9118) 2024-08-15 12:56:17 +01:00
slider setup npm-previews of all packages (#9118) 2024-08-15 12:56:17 +01:00
spa Allow drag and replace image in gr.Image and Multimodal textbox (#9031) 2024-08-19 15:46:54 +01:00
state setup npm-previews of all packages (#9118) 2024-08-15 12:56:17 +01:00
statustracker setup npm-previews of all packages (#9118) 2024-08-15 12:56:17 +01:00
storybook Fix image height content fit (#9116) 2024-08-21 18:41:40 +01:00
tabitem setup npm-previews of all packages (#9118) 2024-08-15 12:56:17 +01:00
tabs setup npm-previews of all packages (#9118) 2024-08-15 12:56:17 +01:00
textbox setup npm-previews of all packages (#9118) 2024-08-15 12:56:17 +01:00
theme setup npm-previews of all packages (#9118) 2024-08-15 12:56:17 +01:00
timer setup npm-previews of all packages (#9118) 2024-08-15 12:56:17 +01:00
tooltip setup npm-previews of all packages (#9118) 2024-08-15 12:56:17 +01:00
tootils chore: update versions (#8960) 2024-08-08 11:20:08 +01:00
upload Allow drag and replace image in gr.Image and Multimodal textbox (#9031) 2024-08-19 15:46:54 +01:00
uploadbutton setup npm-previews of all packages (#9118) 2024-08-15 12:56:17 +01:00
utils Allow accessing the entire row of selected values in gr.DataFrame (#9128) 2024-08-20 21:08:29 +00:00
video setup npm-previews of all packages (#9118) 2024-08-15 12:56:17 +01:00
wasm setup npm-previews of all packages (#9118) 2024-08-15 12:56:17 +01:00
.npmrc
jsx.d.ts update deps + fix tests (#4675) 2023-06-28 22:40:53 +01:00
README.md Updated CI info in contributing docs (#4415) 2023-06-06 08:52:29 -04:00

gradio-ui

This folder contains all of the Gradio UI and component source code.

setup

This folder is managed as 'monorepo' a multi-package repository which make dependency management very simple. In order to do this we use pnpm as our package manager.

Make sure pnpm is installed by following the installation instructions for your system.

You will also need node which you probably already have

running the application

Install all dependencies:

pnpm i

This will install the dependencies for all packages and link any local packages

local development

To develop locally, open two terminal tabs from the root of the repository.

Run the python test server, from the root directory:

cd demo/kitchen_sink
python run.py

This will start a development server on port 7860 that the web app is expecting.

Run the web app:

pnpm dev

building for production

Run the build:

pnpm build

This will create the necessary files in js/app/public and also in gradio/templates/frontend.

quality checks

The repos currently has two quality checks that can be run locally and are run in CI.

formatting

Formatting is handled by prettier to ensure consistent formatting and prevent style-focused conversations. Formatting failures will fails CI and should be reoslve before merging.

To check formatting:

pnpm format:check

If you have formatting failures then you can run the following command to fix them:

pnpm format:write

type checking

We use TypeScript to provide static types to javascript code. These checks are also run in CI.

to typecheck the code:

pnpm ts:check

ci checks

Currently the following checks are run in CI:

static checks

  • Format check (pnpm format:check)
  • Build css (pnpm css)
  • Build client (pnpm build)
  • Type check (pnpm ts:check)
  • Unit tests (pnpm test:run)

functional test

pip install -r demo/outbreak_forecast/requirements.txt
pnpm exec playwright install chromium
pnpm exec playwright install-deps chromium
pnpm test:browser:full