-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add placeholder
param to Image and ImageEditor to replace upload image text
#8930
Merged
Merged
Changes from all commits
Commits
Show all changes
48 commits
Select commit
Hold shift + click to select a range
6b88d32
add info to image
hannahblair de97030
add changeset
gradio-pr-bot b025b77
Merge branch 'main' into info-image
hannahblair 3ef8013
add to image editor
hannahblair fc06bf0
add changeset
gradio-pr-bot 02753c2
format
hannahblair 759955b
Merge branch 'info-image' of github.com:gradio-app/gradio into info-i…
hannahblair 913ee94
Merge branch 'main' into info-image
hannahblair 1769ac5
Merge branch 'main' into info-image
hannahblair 41b32f8
add info to label
hannahblair 458fae6
Merge branch 'main' into info-image
hannahblair 77f0253
remove blocktitle changes
hannahblair 305f583
test
hannahblair 934d027
fix typecheck
hannahblair 23f7d50
revert info changes and add placeholder
hannahblair 6310f08
tweak
hannahblair 81e50d4
add changeset
gradio-pr-bot 6cbbfa9
amend story
hannahblair e9d04a6
Merge branch 'info-image' of https://github.com/gradio-app/gradio int…
hannahblair 17593ae
image editor placeholder
hannahblair 6f40f50
add changeset
gradio-pr-bot d7e1dad
tweak
hannahblair 0e70c42
Merge branch 'info-image' of https://github.com/gradio-app/gradio int…
hannahblair ff0c94f
remove whitespace
hannahblair 09e70c9
remove whitespace
hannahblair 82d8011
type fix
hannahblair 3457ec6
placeholder
abidlabs 0f800a4
Merge branch 'main' into info-image
abidlabs b94b644
allow markdown in placeholder
hannahblair ae12ffd
tweak image story and imageeditor
hannahblair 279e165
tweak
hannahblair bdcd5ab
Merge branch 'main' into info-image
abidlabs 7f5713f
remove marked usage and add parse func
hannahblair 3fc0e73
add image editor parse logic
hannahblair 3d45b85
fix test
hannahblair 73e1748
Merge branch 'main' into info-image
hannahblair 9b18aa7
Merge branch 'info-image' of github.com:gradio-app/gradio into info-i…
hannahblair b825f25
manually inject html, remove @html use
hannahblair 39d97b7
Update gradio/components/image.py
hannahblair 4653b3b
Update gradio/components/image_editor.py
hannahblair 8f35cb4
Merge branch 'main' into info-image
hannahblair 0adaf15
amend story
hannahblair 4fe403e
Merge branch 'info-image' of github.com:gradio-app/gradio into info-i…
hannahblair 6c846ba
tweak py copy
hannahblair f583b05
fix tests
hannahblair 1b2242a
fix duplicate heading logic
hannahblair 39ca07f
make h2 text bigger
hannahblair 4cbd451
add !important
hannahblair File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
"@gradio/atoms": minor | ||
"@gradio/image": minor | ||
"@gradio/imageeditor": minor | ||
"@gradio/simpleimage": minor | ||
"gradio": minor | ||
--- | ||
|
||
feat:Add `placeholder` param to Image and ImageEditor to replace upload image text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
const RE_HEADING = /^(#\s*)(.+)$/m; | ||
|
||
export function inject(text: string): [string | false, string | false] { | ||
const trimmed_text = text.trim(); | ||
|
||
const heading_match = trimmed_text.match(RE_HEADING); | ||
if (!heading_match) { | ||
return [false, trimmed_text || false]; | ||
} | ||
|
||
const [full_match, , heading_content] = heading_match; | ||
const _heading = heading_content.trim(); | ||
|
||
if (trimmed_text === full_match) { | ||
return [_heading, false]; | ||
} | ||
|
||
const heading_end_index = | ||
heading_match.index !== undefined | ||
? heading_match.index + full_match.length | ||
: 0; | ||
const remaining_text = trimmed_text.substring(heading_end_index).trim(); | ||
|
||
const _paragraph = remaining_text || false; | ||
|
||
return [_heading, _paragraph]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tweaked to be consistent with gr.Image