fix rendering of email in README (#625)

* #193 fix rendering of email in README

* use skeleton loader

* bump version
This commit is contained in:
Neil 2023-05-26 13:59:15 +08:00 committed by GitHub
parent ec166132c8
commit 5e6c717361
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 36 additions and 9 deletions

View file

@ -1,6 +1,6 @@
{ {
"name": "tea", "name": "tea",
"version": "0.2.18", "version": "0.2.19",
"private": true, "private": true,
"description": "tea gui app", "description": "tea gui app",
"author": "tea.xyz", "author": "tea.xyz",

View file

@ -1,8 +1,7 @@
<script lang="ts"> <script lang="ts">
import "$appcss"; import "$appcss";
import { t } from "$libs/translations"; import { t } from "$libs/translations";
import SkeletonLoader from "@tea/ui/skeleton-loader/skeleton-loader.svelte";
import Spinner from "@tea/ui/spinner/spinner.svelte";
import { page } from "$app/stores"; import { page } from "$app/stores";
// import PageHeader from '$components/page-header/page-header.svelte'; // import PageHeader from '$components/page-header/page-header.svelte';
import PackageBanner from "$components/package-banner/package-banner.svelte"; import PackageBanner from "$components/package-banner/package-banner.svelte";
@ -86,8 +85,8 @@
<section class="mt-8 flex gap-8"> <section class="mt-8 flex gap-8">
<div class="w-2/3"> <div class="w-2/3">
{#if tabs.length === 0} {#if tabs.length === 0}
<div class="flex w-full justify-center py-20"> <div class="flex w-full justify-center py-10">
<Spinner /> <SkeletonLoader />
</div> </div>
{/if} {/if}
<Tabs {tabs} defaultTab={$t("common.details")} /> <Tabs {tabs} defaultTab={$t("common.details")} />

View file

@ -55,10 +55,12 @@
"dependencies": { "dependencies": {
"@magidoc/plugin-svelte-prismjs": "^3.0.6", "@magidoc/plugin-svelte-prismjs": "^3.0.6",
"@tailwindcss/line-clamp": "^0.4.2", "@tailwindcss/line-clamp": "^0.4.2",
"@types/he": "^1.2.0",
"@types/prismjs": "^1.26.0", "@types/prismjs": "^1.26.0",
"he": "^1.2.0",
"prismjs": "^1.29.0", "prismjs": "^1.29.0",
"restructured": "0.0.11",
"svelte-markdown": "^0.2.3", "svelte-markdown": "^0.2.3",
"svelte-watch-resize": "^1.0.3", "svelte-watch-resize": "^1.0.3"
"restructured": "0.0.11"
} }
} }

View file

@ -1,7 +1,18 @@
<script> <script>
import he from "he";
export let href = ""; export let href = "";
export let title = ""; export let title = "";
let isBlank = href.includes("http") || href.includes("https"); let isBlank = href.includes("http") || href.includes("https");
let isEmail = href.includes("mailto");
console.log("href", href);
const email = isEmail ? he.decode(href.replace("mailto:", "")) : "";
</script> </script>
<a {href} {title} target={isBlank ? "_blank" : ""} rel=""><slot /></a> <a href={email ? `mailto:${email}` : href} {title} target={isBlank ? "_blank" : ""} rel="">
{#if isEmail}
{email}
{:else}
<slot />
{/if}
</a>

View file

@ -0,0 +1,8 @@
<div role="status" class="w-full animate-pulse">
<div class="mb-4 h-2.5 w-48 rounded-full bg-gray opacity-50 dark:opacity-30" />
<div class="mb-2.5 h-2 max-w-[360px] rounded-full bg-gray opacity-50 dark:opacity-30" />
<div class="mb-2.5 h-2 rounded-full bg-gray opacity-50 dark:opacity-30" />
<div class="mb-2.5 h-2 max-w-[330px] rounded-full bg-gray opacity-50 dark:opacity-30" />
<div class="mb-2.5 h-2 max-w-[300px] rounded-full bg-gray opacity-50 dark:opacity-30" />
<div class="h-2 max-w-[360px] rounded-full bg-gray opacity-50 dark:opacity-30" />
</div>

View file

@ -213,6 +213,7 @@ importers:
'@sveltejs/kit': ^1.0.0 '@sveltejs/kit': ^1.0.0
'@sveltejs/package': ^1.0.1 '@sveltejs/package': ^1.0.1
'@tailwindcss/line-clamp': ^0.4.2 '@tailwindcss/line-clamp': ^0.4.2
'@types/he': ^1.2.0
'@types/prismjs': ^1.26.0 '@types/prismjs': ^1.26.0
'@typescript-eslint/eslint-plugin': ^5.27.0 '@typescript-eslint/eslint-plugin': ^5.27.0
'@typescript-eslint/parser': ^5.27.0 '@typescript-eslint/parser': ^5.27.0
@ -221,6 +222,7 @@ importers:
eslint-config-prettier: ^8.3.0 eslint-config-prettier: ^8.3.0
eslint-plugin-storybook: ^0.6.7 eslint-plugin-storybook: ^0.6.7
eslint-plugin-svelte3: ^4.0.0 eslint-plugin-svelte3: ^4.0.0
he: ^1.2.0
postcss: ^8.4.19 postcss: ^8.4.19
prettier: ^2.8.8 prettier: ^2.8.8
prettier-plugin-svelte: ^2.10.0 prettier-plugin-svelte: ^2.10.0
@ -240,7 +242,9 @@ importers:
dependencies: dependencies:
'@magidoc/plugin-svelte-prismjs': 3.6.4_prismjs@1.29.0 '@magidoc/plugin-svelte-prismjs': 3.6.4_prismjs@1.29.0
'@tailwindcss/line-clamp': 0.4.4_tailwindcss@3.3.2 '@tailwindcss/line-clamp': 0.4.4_tailwindcss@3.3.2
'@types/he': 1.2.0
'@types/prismjs': 1.26.0 '@types/prismjs': 1.26.0
he: 1.2.0
prismjs: 1.29.0 prismjs: 1.29.0
restructured: 0.0.11 restructured: 0.0.11
svelte-markdown: 0.2.3_svelte@3.59.1 svelte-markdown: 0.2.3_svelte@3.59.1
@ -3851,6 +3855,10 @@ packages:
'@types/node': 20.1.1 '@types/node': 20.1.1
dev: true dev: true
/@types/he/1.2.0:
resolution: {integrity: sha512-uH2smqTN4uGReAiKedIVzoLUAXIYLBTbSofhx3hbNqj74Ua6KqFsLYszduTrLCMEAEAozF73DbGi/SC1bzQq4g==}
dev: false
/@types/http-cache-semantics/4.0.1: /@types/http-cache-semantics/4.0.1:
resolution: {integrity: sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ==} resolution: {integrity: sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ==}
@ -7858,7 +7866,6 @@ packages:
/he/1.2.0: /he/1.2.0:
resolution: {integrity: sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==} resolution: {integrity: sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==}
hasBin: true hasBin: true
dev: true
/help-me/3.0.0: /help-me/3.0.0:
resolution: {integrity: sha512-hx73jClhyk910sidBB7ERlnhMlFsJJIBqSVMFDwPN8o2v9nmp5KgLq1Xz1Bf1fCMMZ6mPrX159iG0VLy/fPMtQ==} resolution: {integrity: sha512-hx73jClhyk910sidBB7ERlnhMlFsJJIBqSVMFDwPN8o2v9nmp5KgLq1Xz1Bf1fCMMZ6mPrX159iG0VLy/fPMtQ==}