mirror of
https://github.com/gradio-app/gradio.git
synced 2025-02-17 11:29:58 +08:00
Add Clear Mask button to sketch mode (#3615)
* Add Clear Mask button to sketch mode * Update changelog * fix bugs + change icon * tweak --------- Co-authored-by: pngwn <hello@pngwn.io>
This commit is contained in:
parent
8a31766a0e
commit
5c4a9b402e
115
CHANGELOG.md
115
CHANGELOG.md
@ -1,9 +1,8 @@
|
||||
|
||||
# Upcoming Release
|
||||
|
||||
## New Features:
|
||||
|
||||
No changes to highlight.
|
||||
- Add a "clear mask" button to `gr.Image` sketch modes, by [@space-nuko](https://github.com/space-nuko) in [PR 3615](https://github.com/gradio-app/gradio/pull/3615)
|
||||
|
||||
## Bug Fixes:
|
||||
|
||||
@ -32,12 +31,13 @@ No changes to highlight.
|
||||
# 3.28.0
|
||||
|
||||
## Bug Fixes:
|
||||
|
||||
- Fix duplicate play commands in full-screen mode of 'video'. by [@tomchang25](https://github.com/tomchang25) in [PR 3968](https://github.com/gradio-app/gradio/pull/3968).
|
||||
- Fix the issue of the UI stuck caused by the 'selected' of DataFrame not being reset. by [@tomchang25](https://github.com/tomchang25) in [PR 3916](https://github.com/gradio-app/gradio/pull/3916).
|
||||
- Fix issue where `gr.Video()` would not work inside a `gr.Tab()` by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 3891](https://github.com/gradio-app/gradio/pull/3891)
|
||||
- Fixed issue with old_value check in File. by [@tomchang25](https://github.com/tomchang25) in [PR 3859](https://github.com/gradio-app/gradio/pull/3859).
|
||||
- Fixed bug where all bokeh plots appeared in the same div by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3896](https://github.com/gradio-app/gradio/pull/3896)
|
||||
- Fixed image outputs to automatically take full output image height, unless explicitly set, by [@aliabid94](https://github.com/aliabid94) in [PR 3905](https://github.com/gradio-app/gradio/pull/3905)
|
||||
- Fixed image outputs to automatically take full output image height, unless explicitly set, by [@aliabid94](https://github.com/aliabid94) in [PR 3905](https://github.com/gradio-app/gradio/pull/3905)
|
||||
- Fix issue in `gr.Gallery()` where setting height causes aspect ratio of images to collapse by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 3830](https://github.com/gradio-app/gradio/pull/3830)
|
||||
- Fix issue where requesting for a non-existing file would trigger a 500 error by [@micky2be](https://github.com/micky2be) in `[PR 3895](https://github.com/gradio-app/gradio/pull/3895)`.
|
||||
- Fix bugs with abspath about symlinks, and unresolvable path on Windows by [@micky2be](https://github.com/micky2be) in `[PR 3895](https://github.com/gradio-app/gradio/pull/3895)`.
|
||||
@ -97,7 +97,6 @@ with gr.Blocks() as demo:
|
||||
|
||||
See the [image_segmentation demo](https://github.com/gradio-app/gradio/tree/main/demo/image_segmentation) for a full example. By [@aliabid94](https://github.com/aliabid94) in [PR 3836](https://github.com/gradio-app/gradio/pull/3836)
|
||||
|
||||
|
||||
## Bug Fixes:
|
||||
|
||||
No changes to highlight.
|
||||
@ -130,15 +129,14 @@ No changes to highlight.
|
||||
|
||||
- Allow the video component to accept subtitles as input, by [@tomchang25](https://github.com/tomchang25) in [PR 3673](https://github.com/gradio-app/gradio/pull/3673). To provide subtitles, simply return a tuple consisting of `(path_to_video, path_to_subtitles)` from your function. Both `.srt` and `.vtt` formats are supported:
|
||||
|
||||
|
||||
```py
|
||||
with gr.Blocks() as demo:
|
||||
gr.Video(("video.mp4", "captions.srt"))
|
||||
```
|
||||
|
||||
## Bug Fixes:
|
||||
- Fix code markdown support in `gr.Chatbot()` component by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 3816](https://github.com/gradio-app/gradio/pull/3816)
|
||||
|
||||
- Fix code markdown support in `gr.Chatbot()` component by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 3816](https://github.com/gradio-app/gradio/pull/3816)
|
||||
|
||||
## Documentation Changes:
|
||||
|
||||
@ -178,11 +176,11 @@ with gr.Blocks() as demo:
|
||||
def select_handler(img, evt: gr.SelectData):
|
||||
selected_pixel = img[evt.index[1], evt.index[0]]
|
||||
return f"Selected pixel: {selected_pixel}"
|
||||
|
||||
img.select(select_handler, img, textbox)
|
||||
```
|
||||

|
||||
|
||||
img.select(select_handler, img, textbox)
|
||||
```
|
||||
|
||||

|
||||
|
||||
## Bug Fixes:
|
||||
|
||||
@ -247,21 +245,19 @@ No changes to highlight.
|
||||
|
||||
No changes to highlight.
|
||||
|
||||
|
||||
|
||||
# Version 3.24.0
|
||||
|
||||
## New Features:
|
||||
|
||||
- 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)
|
||||
- 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)
|
||||
- Created Theme Builder, which allows users to create themes without writing any code, by [@aliabid94](https://github.com/aliabid94) in [PR 3664](https://github.com/gradio-app/gradio/pull/3664). Launch by:
|
||||
|
||||
```python
|
||||
import gradio as gr
|
||||
gr.themes.builder()
|
||||
```
|
||||
|
||||

|
||||
```python
|
||||
import gradio as gr
|
||||
gr.themes.builder()
|
||||
```
|
||||
|
||||

|
||||
|
||||
- The `Dropdown` component now has a `allow_custom_value` parameter that lets users type in custom values not in the original list of choices.
|
||||
- The `Colorpicker` component now has a `.blur()` event
|
||||
@ -272,19 +268,18 @@ No changes to highlight.
|
||||
|
||||
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)
|
||||
|
||||
- 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)
|
||||
- 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)
|
||||
- Fixes `Chatbot` and `Image` components so that files passed during processing are added to a directory where they can be served from, by [@abidlabs](https://github.com/abidlabs) in [PR 3523](https://github.com/gradio-app/gradio/pull/3523)
|
||||
- Use Gradio API server to send telemetry using `huggingface_hub` [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 3488](https://github.com/gradio-app/gradio/pull/3488)
|
||||
- Fixes an an issue where if the Blocks scope was not exited, then State could be shared across sessions, by [@abidlabs](https://github.com/abidlabs) in [PR 3600](https://github.com/gradio-app/gradio/pull/3600)
|
||||
- Ensures that `gr.load()` loads and applies the upstream theme, by [@abidlabs](https://github.com/abidlabs) in [PR 3641](https://github.com/gradio-app/gradio/pull/3641)
|
||||
- Fixed bug where "or" was not being localized in file upload text by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3599](https://github.com/gradio-app/gradio/pull/3599)
|
||||
- Fixed bug where "or" was not being localized in file upload text by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3599](https://github.com/gradio-app/gradio/pull/3599)
|
||||
- Fixed bug where chatbot does not autoscroll inside of a tab, row or column by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 3637](https://github.com/gradio-app/gradio/pull/3637)
|
||||
- Fixed bug where textbox shrinks when `lines` set to larger than 20 by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 3637](https://github.com/gradio-app/gradio/pull/3637)
|
||||
- Fixed bug where textbox shrinks when `lines` set to larger than 20 by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 3637](https://github.com/gradio-app/gradio/pull/3637)
|
||||
- Ensure CSS has fully loaded before rendering the application, by [@pngwn](https://github.com/pngwn) in [PR 3573](https://github.com/gradio-app/gradio/pull/3573)
|
||||
- Support using an empty list as `gr.Dataframe` value, by [@space-nuko](https://github.com/space-nuko) in [PR 3646](https://github.com/gradio-app/gradio/pull/3646)
|
||||
- Fixed `gr.Image` not filling the entire element size, by [@space-nuko](https://github.com/space-nuko) in [PR 3649](https://github.com/gradio-app/gradio/pull/3649)
|
||||
@ -305,7 +300,6 @@ By [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3581](https://git
|
||||
- Makes some additions to documentation of `Audio` and `State` components, and fixes the `pictionary` demo by [@abidlabs](https://github.com/abidlabs) in [PR 3611](https://github.com/gradio-app/gradio/pull/3611)
|
||||
- Fix outdated sharing your app guide by [@aliabd](https://github.com/aliabd) in [PR 3699](https://github.com/gradio-app/gradio/pull/3699)
|
||||
|
||||
|
||||
## Testing and Infrastructure Changes:
|
||||
|
||||
- Removed heavily-mocked tests related to comet_ml, wandb, and mlflow as they added a significant amount of test dependencies that prevented installation of test dependencies on Windows environemnts. By [@abidlabs](https://github.com/abidlabs) in [PR 3608](https://github.com/gradio-app/gradio/pull/3608)
|
||||
@ -318,36 +312,33 @@ No changes to highlight.
|
||||
|
||||
## Full Changelog:
|
||||
|
||||
- Mobile responsive iframes in themes guide by [@aliabd](https://github.com/aliabd) in [PR 3562](https://github.com/gradio-app/gradio/pull/3562)
|
||||
- Mobile responsive iframes in themes guide by [@aliabd](https://github.com/aliabd) in [PR 3562](https://github.com/gradio-app/gradio/pull/3562)
|
||||
- Remove extra $demo from theme guide by [@aliabd](https://github.com/aliabd) in [PR 3563](https://github.com/gradio-app/gradio/pull/3563)
|
||||
- Set the theme name to be the upstream repo name when loading from the hub by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3595](https://github.com/gradio-app/gradio/pull/3595)
|
||||
- Copy everything in website Dockerfile, fix build issues by [@aliabd](https://github.com/aliabd) in [PR 3659](https://github.com/gradio-app/gradio/pull/3659)
|
||||
- Raise error when an event is queued but the queue is not configured by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3640](https://github.com/gradio-app/gradio/pull/3640)
|
||||
- Allows users to apss in a string name for a built-in theme, by [@abidlabs](https://github.com/abidlabs) in [PR 3641](https://github.com/gradio-app/gradio/pull/3641)
|
||||
- Added `orig_name` to Video output in the backend so that the front end can set the right name for downloaded video files by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3700](https://github.com/gradio-app/gradio/pull/3700)
|
||||
- Set the theme name to be the upstream repo name when loading from the hub by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3595](https://github.com/gradio-app/gradio/pull/3595)
|
||||
- Copy everything in website Dockerfile, fix build issues by [@aliabd](https://github.com/aliabd) in [PR 3659](https://github.com/gradio-app/gradio/pull/3659)
|
||||
- Raise error when an event is queued but the queue is not configured by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3640](https://github.com/gradio-app/gradio/pull/3640)
|
||||
- Allows users to apss in a string name for a built-in theme, by [@abidlabs](https://github.com/abidlabs) in [PR 3641](https://github.com/gradio-app/gradio/pull/3641)
|
||||
- Added `orig_name` to Video output in the backend so that the front end can set the right name for downloaded video files by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3700](https://github.com/gradio-app/gradio/pull/3700)
|
||||
|
||||
## Contributors Shoutout:
|
||||
|
||||
No changes to highlight.
|
||||
|
||||
|
||||
# Version 3.23.0
|
||||
|
||||
|
||||
## New Features:
|
||||
|
||||
### Theme Sharing!
|
||||
### Theme Sharing!
|
||||
|
||||
Once you have created a theme, you can upload it to the HuggingFace Hub to let others view it, use it, and build off of it! You can also download, reuse, and remix other peoples' themes. See https://gradio.app/theming-guide/ for more details.
|
||||
Once you have created a theme, you can upload it to the HuggingFace Hub to let others view it, use it, and build off of it! You can also download, reuse, and remix other peoples' themes. See https://gradio.app/theming-guide/ for more details.
|
||||
|
||||
By [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3428](https://github.com/gradio-app/gradio/pull/3428)
|
||||
By [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3428](https://github.com/gradio-app/gradio/pull/3428)
|
||||
|
||||
## Bug Fixes:
|
||||
|
||||
- Removes leading spaces from all lines of code uniformly in the `gr.Code()` component. By [@abidlabs](https://github.com/abidlabs) in [PR 3556](https://github.com/gradio-app/gradio/pull/3556)
|
||||
- Removes leading spaces from all lines of code uniformly in the `gr.Code()` component. By [@abidlabs](https://github.com/abidlabs) in [PR 3556](https://github.com/gradio-app/gradio/pull/3556)
|
||||
- Fixed broken login page, by [@aliabid94](https://github.com/aliabid94) in [PR 3529](https://github.com/gradio-app/gradio/pull/3529)
|
||||
|
||||
|
||||
## Documentation Changes:
|
||||
|
||||
No changes to highlight.
|
||||
@ -368,17 +359,15 @@ No changes to highlight.
|
||||
|
||||
No changes to highlight.
|
||||
|
||||
|
||||
# Version 3.22.1
|
||||
|
||||
|
||||
## New Features:
|
||||
|
||||
No changes to highlight.
|
||||
|
||||
## Bug Fixes:
|
||||
|
||||
- Restore label bars by [@aliabid94](https://github.com/aliabid94) in [PR 3507](https://github.com/gradio-app/gradio/pull/3507)
|
||||
- Restore label bars by [@aliabid94](https://github.com/aliabid94) in [PR 3507](https://github.com/gradio-app/gradio/pull/3507)
|
||||
|
||||
## Documentation Changes:
|
||||
|
||||
@ -400,10 +389,8 @@ No changes to highlight.
|
||||
|
||||
No changes to highlight.
|
||||
|
||||
|
||||
# Version 3.22.0
|
||||
|
||||
|
||||
## New Features:
|
||||
|
||||
### Official Theme release
|
||||
@ -412,18 +399,18 @@ Gradio now supports a new theme system, which allows you to customize the look a
|
||||
|
||||
### `elem_classes`
|
||||
|
||||
Add keyword argument `elem_classes` to Components to control class names of components, in the same manner as existing `elem_id`.
|
||||
Add keyword argument `elem_classes` to Components to control class names of components, in the same manner as existing `elem_id`.
|
||||
By [@aliabid94](https://github.com/aliabid94) in [PR 3466](https://github.com/gradio-app/gradio/pull/3466)
|
||||
|
||||
## Bug Fixes:
|
||||
|
||||
- Fixes the File.upload() event trigger which broke as part of the change in how we uploaded files by [@abidlabs](https://github.com/abidlabs) in [PR 3462](https://github.com/gradio-app/gradio/pull/3462)
|
||||
- Fixed issue with `gr.Request` object failing to handle dictionaries when nested keys couldn't be converted to variable names [#3454](https://github.com/gradio-app/gradio/issues/3454) by [@radames](https://github.com/radames) in [PR 3459](https://github.com/gradio-app/gradio/pull/3459)
|
||||
- Fixed bug where css and client api was not working properly when mounted in a subpath by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3482](https://github.com/gradio-app/gradio/pull/3482)
|
||||
- Fixed bug where css and client api was not working properly when mounted in a subpath by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3482](https://github.com/gradio-app/gradio/pull/3482)
|
||||
|
||||
## Documentation Changes:
|
||||
|
||||
- Document gr.Error in the docs by [@aliabd](https://github.com/aliabd) in [PR 3465](https://github.com/gradio-app/gradio/pull/3465)
|
||||
- Document gr.Error in the docs by [@aliabd](https://github.com/aliabd) in [PR 3465](https://github.com/gradio-app/gradio/pull/3465)
|
||||
|
||||
## Testing and Infrastructure Changes:
|
||||
|
||||
@ -443,7 +430,6 @@ No changes to highlight.
|
||||
|
||||
No changes to highlight.
|
||||
|
||||
|
||||
# Version 3.21.0
|
||||
|
||||
## New Features:
|
||||
@ -455,6 +441,7 @@ You can now share your gradio themes with the world!
|
||||
After creating a theme, you can upload it to the HuggingFace Hub to let others view it, use it, and build off of it!
|
||||
|
||||
### Uploading
|
||||
|
||||
There are two ways to upload a theme, via the theme class instance or the command line.
|
||||
|
||||
1. Via the class instance
|
||||
@ -468,6 +455,7 @@ my_theme.push_to_hub(repo_name="my_theme",
|
||||
2. Via the command line
|
||||
|
||||
First save the theme to disk
|
||||
|
||||
```python
|
||||
my_theme.dump(filename="my_theme.json")
|
||||
```
|
||||
@ -486,9 +474,10 @@ The `version` must be a valid [semantic version](https://www.geeksforgeeks.org/i
|
||||
|
||||
This creates a space on the huggingface hub to host the theme files and show potential users a preview of your theme.
|
||||
|
||||
An example theme space is here: https://huggingface.co/spaces/freddyaboulton/dracula_revamped
|
||||
An example theme space is here: https://huggingface.co/spaces/freddyaboulton/dracula_revamped
|
||||
|
||||
### Downloading
|
||||
|
||||
To use a theme from the hub, use the `from_hub` method on the `ThemeClass` and pass it to your app:
|
||||
|
||||
```python
|
||||
@ -509,10 +498,9 @@ with gr.Blocks(theme="freddyaboulton/my_theme@>=0.1.0,<0.2.0") as demo:
|
||||
....
|
||||
```
|
||||
|
||||
by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3428](https://github.com/gradio-app/gradio/pull/3428)
|
||||
by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3428](https://github.com/gradio-app/gradio/pull/3428)
|
||||
|
||||
|
||||
### Code component 🦾
|
||||
### Code component 🦾
|
||||
|
||||
New code component allows you to enter, edit and display code with full syntax highlighting by [@pngwn](https://github.com/pngwn) in [PR 3421](https://github.com/gradio-app/gradio/pull/3421)
|
||||
|
||||
@ -531,14 +519,14 @@ gr.Chatbot([
|
||||
|
||||
<img width="1054" alt="image" src="https://user-images.githubusercontent.com/1778297/224116682-5908db47-f0fa-405c-82ab-9c7453e8c4f1.png">
|
||||
|
||||
|
||||
Note: images were previously supported via Markdown syntax and that is still supported for backwards compatibility. By [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 3413](https://github.com/gradio-app/gradio/pull/3413)
|
||||
|
||||
- Allow consecutive function triggers with `.then` and `.success` by [@aliabid94](https://github.com/aliabid94) in [PR 3430](https://github.com/gradio-app/gradio/pull/3430)
|
||||
- Allow consecutive function triggers with `.then` and `.success` by [@aliabid94](https://github.com/aliabid94) in [PR 3430](https://github.com/gradio-app/gradio/pull/3430)
|
||||
|
||||
- New code component allows you to enter, edit and display code with full syntax highlighting by [@pngwn](https://github.com/pngwn) in [PR 3421](https://github.com/gradio-app/gradio/pull/3421)
|
||||
|
||||

|
||||
|
||||
- Added the `.select()` event listener, which also includes event data that can be passed as an argument to a function with type hint `gr.SelectData`. The following components support the `.select()` event listener: Chatbot, CheckboxGroup, Dataframe, Dropdown, File, Gallery, HighlightedText, Label, Radio, TabItem, Tab, Textbox. Example usage:
|
||||
|
||||
```python
|
||||
@ -550,32 +538,34 @@ with gr.Blocks() as demo:
|
||||
|
||||
def on_select(evt: gr.SelectData):
|
||||
return evt.index
|
||||
|
||||
|
||||
gallery.select(on_select, None, selected_index)
|
||||
```
|
||||
|
||||
By [@aliabid94](https://github.com/aliabid94) in [PR 3399](https://github.com/gradio-app/gradio/pull/3399)
|
||||
|
||||
|
||||
- The `Textbox` component now includes a copy button by [@abidlabs](https://github.com/abidlabs) in [PR 3452](https://github.com/gradio-app/gradio/pull/3452)
|
||||
|
||||
## Bug Fixes:
|
||||
|
||||
- Use `huggingface_hub` to send telemetry on `interface` and `blocks`; eventually to replace segment by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 3342](https://github.com/gradio-app/gradio/pull/3342)
|
||||
- Ensure load events created by components (randomize for slider, callable values) are never queued unless every is passed by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3391](https://github.com/gradio-app/gradio/pull/3391)
|
||||
- Ensure load events created by components (randomize for slider, callable values) are never queued unless every is passed by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3391](https://github.com/gradio-app/gradio/pull/3391)
|
||||
- Prevent in-place updates of `generic_update` by shallow copying by [@gitgithan](https://github.com/gitgithan) in [PR 3405](https://github.com/gradio-app/gradio/pull/3405) to fix [#3282](https://github.com/gradio-app/gradio/issues/3282)
|
||||
- Fix bug caused by not importing `BlockContext` in `utils.py` by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3424](https://github.com/gradio-app/gradio/pull/3424)
|
||||
- Ensure dropdown does not highlight partial matches by [@pngwn](https://github.com/pngwn) in [PR 3421](https://github.com/gradio-app/gradio/pull/3421)
|
||||
- Fix mic button display by [@aliabid94](https://github.com/aliabid94) in [PR 3456](https://github.com/gradio-app/gradio/pull/3456)
|
||||
|
||||
## Documentation Changes:
|
||||
- Added a section on security and access when sharing Gradio apps by [@abidlabs](https://github.com/abidlabs) in [PR 3408](https://github.com/gradio-app/gradio/pull/3408)
|
||||
|
||||
- Added a section on security and access when sharing Gradio apps by [@abidlabs](https://github.com/abidlabs) in [PR 3408](https://github.com/gradio-app/gradio/pull/3408)
|
||||
- Add Chinese README by [@uanu2002](https://github.com/uanu2002) in [PR 3394](https://github.com/gradio-app/gradio/pull/3394)
|
||||
- Adds documentation for web components by [@abidlabs](https://github.com/abidlabs) in [PR 3407](https://github.com/gradio-app/gradio/pull/3407)
|
||||
- Fixed link in Chinese readme by [@eltociear](https://github.com/eltociear) in [PR 3417](https://github.com/gradio-app/gradio/pull/3417)
|
||||
- Fixed link in Chinese readme by [@eltociear](https://github.com/eltociear) in [PR 3417](https://github.com/gradio-app/gradio/pull/3417)
|
||||
- Document Blocks methods by [@aliabd](https://github.com/aliabd) in [PR 3427](https://github.com/gradio-app/gradio/pull/3427)
|
||||
- Fixed bug where event handlers were not showing up in documentation by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3434](https://github.com/gradio-app/gradio/pull/3434)
|
||||
- Fixed bug where event handlers were not showing up in documentation by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 3434](https://github.com/gradio-app/gradio/pull/3434)
|
||||
|
||||
## Testing and Infrastructure Changes:
|
||||
|
||||
- Fixes tests that were failing locally but passing on CI by [@abidlabs](https://github.com/abidlabs) in [PR 3411](https://github.com/gradio-app/gradio/pull/3411)
|
||||
- Remove codecov from the repo by [@aliabd](https://github.com/aliabd) in [PR 3415](https://github.com/gradio-app/gradio/pull/3415)
|
||||
|
||||
@ -584,10 +574,11 @@ By [@aliabid94](https://github.com/aliabid94) in [PR 3399](https://github.com/gr
|
||||
No changes to highlight.
|
||||
|
||||
## Full Changelog:
|
||||
|
||||
- Prevent in-place updates of `generic_update` by shallow copying by [@gitgithan](https://github.com/gitgithan) in [PR 3405](https://github.com/gradio-app/gradio/pull/3405) to fix [#3282](https://github.com/gradio-app/gradio/issues/3282)
|
||||
- Persist file names of files uploaded through any Gradio component by [@abidlabs](https://github.com/abidlabs) in [PR 3412](https://github.com/gradio-app/gradio/pull/3412)
|
||||
- Fix markdown embedded component in docs by [@aliabd](https://github.com/aliabd) in [PR 3410](https://github.com/gradio-app/gradio/pull/3410)
|
||||
- Clean up event listeners code by [@aliabid94](https://github.com/aliabid94) in [PR 3420](https://github.com/gradio-app/gradio/pull/3420)
|
||||
- Clean up event listeners code by [@aliabid94](https://github.com/aliabid94) in [PR 3420](https://github.com/gradio-app/gradio/pull/3420)
|
||||
- Fix css issue with spaces logo by [@aliabd](https://github.com/aliabd) in [PR 3422](https://github.com/gradio-app/gradio/pull/3422)
|
||||
- Makes a few fixes to the `JSON` component (show_label parameter, icons) in [@abidlabs](https://github.com/abidlabs) in [PR 3451](https://github.com/gradio-app/gradio/pull/3451)
|
||||
|
||||
@ -2665,8 +2656,8 @@ Here's a simple example that embeds the demo from a Hugging Face space:
|
||||
|
||||
```html
|
||||
<script
|
||||
type="module"
|
||||
src="https://gradio.s3-us-west-2.amazonaws.com/3.0.18/gradio.js"
|
||||
type="module"
|
||||
src="https://gradio.s3-us-west-2.amazonaws.com/3.0.18/gradio.js"
|
||||
></script>
|
||||
<gradio-app space="abidlabs/pytorch-image-classifier"></gradio-app>
|
||||
```
|
||||
|
10
js/icons/src/Erase.svelte
Normal file
10
js/icons/src/Erase.svelte
Normal file
@ -0,0 +1,10 @@
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="100%"
|
||||
height="100%"
|
||||
viewBox="0 0 32 32"
|
||||
><path
|
||||
fill="currentColor"
|
||||
d="M7 27h23v2H7zm20.38-16.49l-7.93-7.92a2 2 0 0 0-2.83 0l-14 14a2 2 0 0 0 0 2.83L7.13 24h9.59l10.66-10.66a2 2 0 0 0 0-2.83zM15.89 22H8l-4-4l6.31-6.31l7.93 7.92zm3.76-3.76l-7.92-7.93L18 4l8 7.93z"
|
||||
/></svg
|
||||
>
|
After Width: | Height: | Size: 330 B |
20
js/icons/src/Trash.svelte
Normal file
20
js/icons/src/Trash.svelte
Normal file
@ -0,0 +1,20 @@
|
||||
<svg id="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
|
||||
<defs>
|
||||
<style>
|
||||
.cls-1 {
|
||||
fill: none;
|
||||
}
|
||||
</style>
|
||||
</defs>
|
||||
<rect x="12" y="12" width="2" height="12" />
|
||||
<rect x="18" y="12" width="2" height="12" />
|
||||
<path d="M4,6V8H6V28a2,2,0,0,0,2,2H24a2,2,0,0,0,2-2V8h2V6ZM8,28V8H24V28Z" />
|
||||
<rect x="12" y="2" width="8" height="2" />
|
||||
<rect
|
||||
id="_Transparent_Rectangle_"
|
||||
data-name="<Transparent Rectangle>"
|
||||
class="cls-1"
|
||||
width="32"
|
||||
height="32"
|
||||
/>
|
||||
</svg>
|
After Width: | Height: | Size: 492 B |
@ -8,8 +8,10 @@ export { default as Clear } from "./Clear.svelte";
|
||||
export { default as Code } from "./Code.svelte";
|
||||
export { default as Color } from "./Color.svelte";
|
||||
export { default as Copy } from "./Copy.svelte";
|
||||
export { default as Download } from "./Download.svelte";
|
||||
export { default as DropdownArrow } from "./DropdownArrow.svelte";
|
||||
export { default as Edit } from "./Edit.svelte";
|
||||
export { default as Erase } from "./Erase.svelte";
|
||||
export { default as File } from "./File.svelte";
|
||||
export { default as Image } from "./Image.svelte";
|
||||
export { default as JSON } from "./JSON.svelte";
|
||||
@ -24,7 +26,7 @@ export { default as Sketch } from "./Sketch.svelte";
|
||||
export { default as Square } from "./Square.svelte";
|
||||
export { default as Table } from "./Table.svelte";
|
||||
export { default as TextHighlight } from "./TextHighlight.svelte";
|
||||
export { default as Trash } from "./Trash.svelte";
|
||||
export { default as Tree } from "./Tree.svelte";
|
||||
export { default as Undo } from "./Undo.svelte";
|
||||
export { default as Video } from "./Video.svelte";
|
||||
export { default as Download } from "./Download.svelte";
|
||||
|
@ -116,6 +116,11 @@
|
||||
static_image = undefined;
|
||||
}
|
||||
|
||||
async function handle_mask_clear() {
|
||||
sketch.clear_mask();
|
||||
await tick();
|
||||
}
|
||||
|
||||
let img_height = 0;
|
||||
let img_width = 0;
|
||||
let container_height = 0;
|
||||
@ -245,8 +250,10 @@
|
||||
{shape}
|
||||
/>
|
||||
<ModifySketch
|
||||
show_eraser={value_img}
|
||||
on:undo={() => sketch.undo()}
|
||||
on:clear={handle_sketch_clear}
|
||||
on:clear_mask={handle_mask_clear}
|
||||
on:remove_image={handle_sketch_clear}
|
||||
/>
|
||||
{#if tool === "color-sketch" || tool === "sketch"}
|
||||
<SketchSettings
|
||||
@ -273,7 +280,7 @@
|
||||
{:else if source === "canvas"}
|
||||
<ModifySketch
|
||||
on:undo={() => sketch.undo()}
|
||||
on:clear={handle_sketch_clear}
|
||||
on:remove_image={handle_sketch_clear}
|
||||
/>
|
||||
{#if tool === "color-sketch"}
|
||||
<SketchSettings
|
||||
@ -354,7 +361,7 @@
|
||||
/>
|
||||
<ModifySketch
|
||||
on:undo={() => sketch.undo()}
|
||||
on:clear={handle_sketch_clear}
|
||||
on:remove_image={handle_sketch_clear}
|
||||
/>
|
||||
{#if tool === "color-sketch" || tool === "sketch"}
|
||||
<SketchSettings
|
||||
|
@ -1,18 +1,32 @@
|
||||
<script lang="ts">
|
||||
import { createEventDispatcher } from "svelte";
|
||||
import { IconButton } from "@gradio/atoms";
|
||||
import { Undo, Clear } from "@gradio/icons";
|
||||
import { Undo, Clear, Erase } from "@gradio/icons";
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
|
||||
export let show_eraser: boolean = false;
|
||||
</script>
|
||||
|
||||
<div>
|
||||
<IconButton Icon={Undo} label="Undo" on:click={() => dispatch("undo")} />
|
||||
|
||||
{#if show_eraser}
|
||||
<IconButton
|
||||
Icon={Erase}
|
||||
label="Clear"
|
||||
on:click={(event) => {
|
||||
dispatch("clear_mask");
|
||||
event.stopPropagation();
|
||||
}}
|
||||
/>
|
||||
{/if}
|
||||
|
||||
<IconButton
|
||||
Icon={Clear}
|
||||
label="Clear"
|
||||
label="Remove Image"
|
||||
on:click={(event) => {
|
||||
dispatch("clear");
|
||||
dispatch("remove_image");
|
||||
event.stopPropagation();
|
||||
}}
|
||||
/>
|
||||
|
@ -219,9 +219,7 @@
|
||||
canvas_observer.unobserve(canvas_container);
|
||||
});
|
||||
|
||||
export function undo() {
|
||||
const _lines = lines.slice(0, -1);
|
||||
|
||||
function redraw_image(_lines) {
|
||||
clear_canvas();
|
||||
|
||||
if (value_img) {
|
||||
@ -250,6 +248,19 @@
|
||||
if (lines.length == 0) {
|
||||
dispatch("clear");
|
||||
}
|
||||
}
|
||||
|
||||
export function clear_mask() {
|
||||
const _lines = [];
|
||||
|
||||
redraw_image(_lines);
|
||||
trigger_on_change();
|
||||
}
|
||||
|
||||
export function undo() {
|
||||
const _lines = lines.slice(0, -1);
|
||||
|
||||
redraw_image(_lines);
|
||||
trigger_on_change();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user