Skip to content

Commit

Permalink
Fix static issues with Lite on v4 (#6124)
Browse files Browse the repository at this point in the history
* fix missing props

* fix path to types

* add changeset

* fix path to i18n

* fix audio tests

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Ali Abid <aabid94@gmail.com>
  • Loading branch information
3 people committed Oct 27, 2023
1 parent c3bc515 commit a7435ba
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 42 deletions.
7 changes: 7 additions & 0 deletions .changeset/busy-snails-matter.md
@@ -0,0 +1,7 @@
---
"@gradio/app": minor
"@gradio/audio": minor
"gradio": minor
---

feat:Fix static issues with Lite on v4
7 changes: 7 additions & 0 deletions js/app/src/lite/ErrorDisplay.svelte
@@ -1,17 +1,24 @@
<script lang="ts">
import { StatusTracker } from "@gradio/statustracker";
import { _ } from "svelte-i18n";
import { setupi18n } from "../i18n";
setupi18n();
export let is_embed: boolean;
export let error: Error | undefined = undefined;
</script>

<StatusTracker
i18n={$_}
absolute={!is_embed}
status="error"
timer={false}
queue_position={null}
queue_size={null}
translucent={true}
autoscroll={false}
>
<div class="error" slot="error">
{#if error}
Expand Down
2 changes: 1 addition & 1 deletion js/app/src/lite/index.ts
Expand Up @@ -8,7 +8,7 @@ import { wasm_proxied_mount_css, mount_prebuilt_css } from "./css";
import type { mount_css } from "../css";
import Index from "../Index.svelte";
import ErrorDisplay from "./ErrorDisplay.svelte";
import type { ThemeMode } from "../components/types";
import type { ThemeMode } from "../types";
import { bootstrap_custom_element } from "./custom-element";

// These imports are aliased at built time with Vite. See the `resolve.alias` config in `vite.config.ts`.
Expand Down
5 changes: 4 additions & 1 deletion js/audio/audio.test.ts
Expand Up @@ -3,6 +3,9 @@ import { cleanup, render } from "@gradio/tootils";
import Audio from "./Index.svelte";
import type { LoadingStatus } from "@gradio/statustracker";
import { setupi18n } from "../app/src/i18n";
import ResizeObserver from 'resize-observer-polyfill'

global.ResizeObserver = ResizeObserver

const loading_status: LoadingStatus = {
eta: 0,
Expand Down Expand Up @@ -30,6 +33,6 @@ describe("Audio", () => {
theme_mode: "dark"
});

assert.exists(getAllByTestId("music-audio"));
assert.exists(getAllByTestId("waveform-music"));
});
});
1 change: 1 addition & 0 deletions js/audio/package.json
Expand Up @@ -16,6 +16,7 @@
"@gradio/wasm": "workspace:^",
"extendable-media-recorder": "^9.0.0",
"extendable-media-recorder-wav-encoder": "^7.0.76",
"resize-observer-polyfill": "^1.5.1",
"svelte-range-slider-pips": "^2.0.1"
},
"main_changeset": true,
Expand Down
47 changes: 7 additions & 40 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a7435ba

Please sign in to comment.