From 93fc49b4815f9c81d490e281ab7a6e8da3c13ea4 Mon Sep 17 00:00:00 2001 From: kiosion Date: Fri, 16 Feb 2024 04:06:28 -0500 Subject: [PATCH] feat: Replace tippy with custom tooltip component --- svelte-app/package.json | 1 - svelte-app/pnpm-lock.yaml | 13 -- svelte-app/src/components/code-block.svelte | 4 +- .../controls/language-toggle.svelte | 4 +- .../components/controls/theme-toggle.svelte | 4 +- svelte-app/src/components/footer.svelte | 11 +- svelte-app/src/components/link.svelte | 3 +- .../components/portable-text/footnote.svelte | 4 +- .../portable-text/portable-text.svelte | 4 +- svelte-app/src/components/tooltip.svelte | 90 ------------ .../src/components/tooltips/inner.svelte | 137 ++++++++++++++++++ .../src/components/tooltips/manager.svelte | 9 ++ .../src/components/tooltips/tooltip.svelte | 91 ++++++++++++ svelte-app/src/lib/tooltips.ts | 44 ++++++ svelte-app/src/routes/+layout.svelte | 3 + 15 files changed, 297 insertions(+), 125 deletions(-) delete mode 100644 svelte-app/src/components/tooltip.svelte create mode 100644 svelte-app/src/components/tooltips/inner.svelte create mode 100644 svelte-app/src/components/tooltips/manager.svelte create mode 100644 svelte-app/src/components/tooltips/tooltip.svelte create mode 100644 svelte-app/src/lib/tooltips.ts diff --git a/svelte-app/package.json b/svelte-app/package.json index 65d401cc9..c65ea0211 100644 --- a/svelte-app/package.json +++ b/svelte-app/package.json @@ -56,7 +56,6 @@ "svelte-eslint-parser": "0.33.1", "svelte-highlight": "7.6.0", "tailwindcss": "3.4.1", - "tippy.js": "6.3.7", "twemoji": "14.0.2", "typescript": "5.3.3", "vite": "5.1.1", diff --git a/svelte-app/pnpm-lock.yaml b/svelte-app/pnpm-lock.yaml index d4083c504..0f148956a 100644 --- a/svelte-app/pnpm-lock.yaml +++ b/svelte-app/pnpm-lock.yaml @@ -113,9 +113,6 @@ devDependencies: tailwindcss: specifier: 3.4.1 version: 3.4.1 - tippy.js: - specifier: 6.3.7 - version: 6.3.7 twemoji: specifier: 14.0.2 version: 14.0.2 @@ -1444,10 +1441,6 @@ packages: resolution: {integrity: sha512-2LuNTFBIO0m7kKIQvvPHN6UE63VjpmL9rnEEaOOaiSPbZK+zUOYIzBAWcED+3XYzhYsd/0mD57VdxAEqqV52CQ==} dev: true - /@popperjs/core@2.11.6: - resolution: {integrity: sha512-50/17A98tWUfQ176raKiOGXuYpLyyVMkxxG6oylzL3BPOlA6ADGdK7EYunSa4I064xerltq9TGXs8HmOk5E+vw==} - dev: true - /@portabletext/svelte@2.1.5(svelte@4.2.10): resolution: {integrity: sha512-NDHIT6TRPnWCGnr0VjwsmYtuhZRVkD41aexajtElwsVLSoYUf/mxXd6PVxjg1e12DfubQo4aQv6lpRthIVbIIA==} peerDependencies: @@ -9879,12 +9872,6 @@ packages: engines: {node: '>=14.0.0'} dev: true - /tippy.js@6.3.7: - resolution: {integrity: sha512-E1d3oP2emgJ9dRQZdf3Kkn0qJgI6ZLpyS5z6ZkY1DF3kaQaBsGZsndEpHwx+eC+tYM41HaSNvNtLx8tU57FzTQ==} - dependencies: - '@popperjs/core': 2.11.6 - dev: true - /tmp-promise@3.0.3: resolution: {integrity: sha512-RwM7MoPojPxsOBYnyd2hy0bxtIlVrihNs9pj5SUvY8Zz1sQcQG2tG1hSr8PDxfgEB8RNKDhqbIlroIarSNDNsQ==} dependencies: diff --git a/svelte-app/src/components/code-block.svelte b/svelte-app/src/components/code-block.svelte index 0f36dd3a6..87ca6c5be 100644 --- a/svelte-app/src/components/code-block.svelte +++ b/svelte-app/src/components/code-block.svelte @@ -9,7 +9,7 @@ import { genericAsyncImport, getLangType } from '$components/code-block/imports'; import Icon from '$components/icon.svelte'; import Spinner from '$components/loading/spinner.svelte'; - import Tooltip from '$components/tooltip.svelte'; + import Tooltip from '$components/tooltips/tooltip.svelte'; import type { ResolvedComponentType } from '$components/code-block/imports'; import type { Unsubscriber } from 'svelte/store'; @@ -110,7 +110,7 @@ {filename} {/if} - +