diff --git a/.changeset/clear-falcons-lose.md b/.changeset/clear-falcons-lose.md new file mode 100644 index 0000000000000..3ea66b2741c3d --- /dev/null +++ b/.changeset/clear-falcons-lose.md @@ -0,0 +1,8 @@ +--- +"@gradio/multimodaltextbox": patch +"@gradio/simpletextbox": patch +"@gradio/textbox": patch +"gradio": patch +--- + +fix:Fix a bug in example textbox rendering when it is initially invisible diff --git a/.changeset/cyan-lights-sleep.md b/.changeset/cyan-lights-sleep.md new file mode 100644 index 0000000000000..c51b7dc524da1 --- /dev/null +++ b/.changeset/cyan-lights-sleep.md @@ -0,0 +1,5 @@ +--- +"gradio": patch +--- + +feat:Pin multipart version to fix issues with yanking diff --git a/.github/actions/install-frontend-deps/action.yml b/.github/actions/install-frontend-deps/action.yml index 9c858df91339e..b465a253ea6bb 100644 --- a/.github/actions/install-frontend-deps/action.yml +++ b/.github/actions/install-frontend-deps/action.yml @@ -25,7 +25,7 @@ runs: with: path: | js/lite/dist/** - key: gradio-lib-front-end-lite-${{ hashFiles('js/**', 'client/js/**', 'gradio/**')}} + key: gradio-lib-front-end-lite-${{ hashFiles('js/**', 'client/js/**', 'gradio/**', 'requirements.txt')}} - name: Install pnpm uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # @v4 with: diff --git a/js/multimodaltextbox/Example.svelte b/js/multimodaltextbox/Example.svelte index 695eb161a095c..6f8456645ba19 100644 --- a/js/multimodaltextbox/Example.svelte +++ b/js/multimodaltextbox/Example.svelte @@ -15,12 +15,11 @@ let el: HTMLDivElement; function set_styles(element: HTMLElement, el_width: number): void { - if (!element || !el_width) return; - el.style.setProperty( + element.style.setProperty( "--local-text-width", - `${el_width < 150 ? el_width : 200}px` + `${el_width && el_width < 150 ? el_width : 200}px` ); - el.style.whiteSpace = "unset"; + element.style.whiteSpace = "unset"; } onMount(() => { diff --git a/js/simpletextbox/Example.svelte b/js/simpletextbox/Example.svelte index e8e8130c2987f..be119a239cfc6 100644 --- a/js/simpletextbox/Example.svelte +++ b/js/simpletextbox/Example.svelte @@ -9,12 +9,11 @@ let el: HTMLDivElement; function set_styles(element: HTMLElement, el_width: number): void { - if (!element || !el_width) return; - el.style.setProperty( + element.style.setProperty( "--local-text-width", - `${el_width < 150 ? el_width : 200}px` + `${el_width && el_width < 150 ? el_width : 200}px` ); - el.style.whiteSpace = "unset"; + element.style.whiteSpace = "unset"; } onMount(() => { diff --git a/js/textbox/Example.svelte b/js/textbox/Example.svelte index e8e8130c2987f..be119a239cfc6 100644 --- a/js/textbox/Example.svelte +++ b/js/textbox/Example.svelte @@ -9,12 +9,11 @@ let el: HTMLDivElement; function set_styles(element: HTMLElement, el_width: number): void { - if (!element || !el_width) return; - el.style.setProperty( + element.style.setProperty( "--local-text-width", - `${el_width < 150 ? el_width : 200}px` + `${el_width && el_width < 150 ? el_width : 200}px` ); - el.style.whiteSpace = "unset"; + element.style.whiteSpace = "unset"; } onMount(() => { diff --git a/requirements.txt b/requirements.txt index de88f2b6c24c5..ef0ca280405aa 100644 --- a/requirements.txt +++ b/requirements.txt @@ -14,7 +14,7 @@ packaging pandas>=1.0,<3.0 pillow>=8.0,<12.0 pydantic>=2.0 -python-multipart>=0.0.9,!=0.0.13 # required for fastapi forms. 0.0.13 was yanked from PyPI but micropip now ignores the yanked flag so we explicitly exclude it. +python-multipart==0.0.12 # required for fastapi forms. pinning to avoid yanking issues with micropip. pydub pyyaml>=5.0,<7.0 ruff>=0.2.2; sys.platform != 'emscripten'