diff --git a/package.json b/package.json index 17ccb9f7..d895be2b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tea", - "version": "0.2.40", + "version": "0.2.41", "private": true, "description": "tea gui app", "author": "tea.xyz", diff --git a/svelte/src/components/package-banner/package-banner.svelte b/svelte/src/components/package-banner/package-banner.svelte index 7651c821..0673b707 100644 --- a/svelte/src/components/package-banner/package-banner.svelte +++ b/svelte/src/components/package-banner/package-banner.svelte @@ -95,7 +95,7 @@ {/if} -
+

{getPackageName(pkg)} @@ -117,7 +117,7 @@ {pkg.maintainer} {/if}

{pkg.description}

- +
+ import Markdown from "$components/markdown/markdown.svelte"; + import PackageBanner from "$components/package-banner/package-banner.svelte"; + import PackageMetas from "$components/package-metas/package-metas.svelte"; + import useDefaultBrowser from "$libs/utils/use-default-browser"; + import type { GUIPackage } from "$libs/types"; + + export let pkg: GUIPackage; + + $: readme = pkg?.readme || ({ data: "", type: "md" } as { data: string; type: "md" | "rst" }); + + +
+ +
+ +
+
+ {#if pkg} + + {/if} +
diff --git a/svelte/src/components/tabs/tab.svelte b/svelte/src/components/tabs/tab.svelte new file mode 100644 index 00000000..8fe665ad --- /dev/null +++ b/svelte/src/components/tabs/tab.svelte @@ -0,0 +1,24 @@ + + + + + diff --git a/svelte/src/components/tabs/tabs.svelte b/svelte/src/components/tabs/tabs.svelte deleted file mode 100644 index 43e5b973..00000000 --- a/svelte/src/components/tabs/tabs.svelte +++ /dev/null @@ -1,49 +0,0 @@ - - -
- - {#each tabs as tab} -
- -
- {/each} -
- - {#each tabs as tab} -
- -
- {/each} -
diff --git a/svelte/src/components/terminal/terminal.svelte b/svelte/src/components/terminal/terminal.svelte index 7805d166..90bbaf1f 100644 --- a/svelte/src/components/terminal/terminal.svelte +++ b/svelte/src/components/terminal/terminal.svelte @@ -42,12 +42,25 @@ fitAddon.fit(); }); + // Detect when the containing div is resized and resize the terminal const resizeObserver = new ResizeObserver((entries) => { fitAddon.fit(); }); resizeObserver.observe(terminalDiv); - return () => resizeObserver.unobserve(terminalDiv); + // Detect when the terminal div becomes visible on the screen and resize the terminal + var visibilityObserver = new IntersectionObserver((entries, observer) => { + // resize the terminal, but only after a delay allowing it to fully render or else the fitAddon will get the wrong size + setTimeout(() => { + fitAddon.fit(); + }, 10); + }); + visibilityObserver.observe(terminalDiv); + + return () => { + resizeObserver.unobserve(terminalDiv); + visibilityObserver.unobserve(terminalDiv); + }; }); onDestroy(() => { @@ -57,9 +70,9 @@ }); - -
-
+ +
+
+
+
diff --git a/svelte/src/components/web-ui/web-ui.svelte b/svelte/src/components/web-ui/web-ui.svelte index 1c24c75b..261caaca 100644 --- a/svelte/src/components/web-ui/web-ui.svelte +++ b/svelte/src/components/web-ui/web-ui.svelte @@ -4,17 +4,10 @@ {#if pty && pty.guiURL} -
-