Ensure show_label param is used in HighlightedText (#10004)

* use show_label param

* add changeset

* add changeset

* * remove empty label spacing
* increase empty area

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
This commit is contained in:
Hannah 2024-11-20 23:34:40 +00:00 committed by GitHub
parent c3324d7f7f
commit 0879be78b3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 3 deletions

View File

@ -0,0 +1,6 @@
---
"@gradio/highlightedtext": patch
"gradio": patch
---
fix:Ensure `show_label` param is used in HighlightedText

View File

@ -36,6 +36,7 @@
export let _selectable = false;
export let combine_adjacent = false;
export let interactive: boolean;
export let show_label = true;
$: if (!color_map && Object.keys(color_map).length) {
color_map = color_map;
@ -73,12 +74,13 @@
{...loading_status}
on:clear_status={() => gradio.dispatch("clear_status", loading_status)}
/>
{#if label}
{#if label && show_label}
<BlockLabel
Icon={TextHighlight}
{label}
float={false}
disable={container === false}
{show_label}
/>
{/if}
@ -115,12 +117,13 @@
i18n={gradio.i18n}
on:clear_status={() => gradio.dispatch("clear_status", loading_status)}
/>
{#if label}
{#if label && show_label}
<BlockLabel
Icon={TextHighlight}
{label}
float={false}
disable={container === false}
{show_label}
/>
{/if}
@ -133,7 +136,7 @@
{color_map}
/>
{:else}
<Empty>
<Empty size="small" unpadded_box={true}>
<TextHighlight />
</Empty>
{/if}