From 042a30941779e56b4470761a27701b00df0301a4 Mon Sep 17 00:00:00 2001 From: kiosion Date: Sun, 13 Oct 2024 21:45:55 -0400 Subject: [PATCH] refac: Tooltips, sidebar toggles --- svelte-app/package.json | 1 + svelte-app/pnpm-lock.yaml | 23 ++ svelte-app/src/components/code-block.svelte | 5 +- .../components/controls/base-toggle.svelte | 40 +-- .../components/document/content/header.svelte | 4 +- .../src/components/experiments/gol.svelte | 2 +- .../components/experiments/mag-cursor.svelte | 4 +- svelte-app/src/components/images/image.svelte | 4 +- svelte-app/src/components/link.svelte | 9 +- .../src/components/nav/confetti-piece.svelte | 39 --- svelte-app/src/components/nav/confetti.svelte | 18 -- .../src/components/nav/header-logo.svelte | 35 --- .../components/portable-text/footnote.svelte | 2 +- .../portable-text/portable-text.svelte | 2 +- svelte-app/src/components/sidebar.svelte | 18 +- .../sidebar/sidebar-headings.svelte | 8 +- .../sidebar-link.svelte} | 32 ++- .../components/sidebar/sidebar-tooltip.svelte | 42 ++++ svelte-app/src/components/sidebar/tooltips.ts | 3 + .../src/components/tooltips/inner.svelte | 231 ++++++++---------- .../src/components/tooltips/manager.svelte | 11 - .../src/components/tooltips/tooltip.svelte | 110 +++++---- svelte-app/src/lib/tooltips.ts | 61 ----- svelte-app/src/routes/+layout.svelte | 5 +- 24 files changed, 307 insertions(+), 402 deletions(-) delete mode 100644 svelte-app/src/components/nav/confetti-piece.svelte delete mode 100644 svelte-app/src/components/nav/confetti.svelte delete mode 100644 svelte-app/src/components/nav/header-logo.svelte rename svelte-app/src/components/{nav/header-link.svelte => sidebar/sidebar-link.svelte} (69%) create mode 100644 svelte-app/src/components/sidebar/sidebar-tooltip.svelte create mode 100644 svelte-app/src/components/sidebar/tooltips.ts delete mode 100644 svelte-app/src/components/tooltips/manager.svelte delete mode 100644 svelte-app/src/lib/tooltips.ts diff --git a/svelte-app/package.json b/svelte-app/package.json index 7e51646e4..b954d31ad 100644 --- a/svelte-app/package.json +++ b/svelte-app/package.json @@ -21,6 +21,7 @@ "lint": "pnpm format && pnpm eslint --fix \"./src/**/*.{ts,svelte}\" \"./types/**/*.ts\"" }, "devDependencies": { + "@floating-ui/dom": "^1.6.11", "@playwright/test": "1.44.1", "@portabletext/svelte": "2.1.11", "@portabletext/toolkit": "2.0.15", diff --git a/svelte-app/pnpm-lock.yaml b/svelte-app/pnpm-lock.yaml index 2172e1569..8c105ac63 100644 --- a/svelte-app/pnpm-lock.yaml +++ b/svelte-app/pnpm-lock.yaml @@ -8,6 +8,9 @@ importers: .: devDependencies: + '@floating-ui/dom': + specifier: ^1.6.11 + version: 1.6.11 '@playwright/test': specifier: 1.44.1 version: 1.44.1 @@ -663,6 +666,15 @@ packages: '@fastify/static@7.0.4': resolution: {integrity: sha512-p2uKtaf8BMOZWLs6wu+Ihg7bWNBdjNgCwDza4MJtTqg+5ovKmcbgbR9Xs5/smZ1YISfzKOCNYmZV8LaCj+eJ1Q==} + '@floating-ui/core@1.6.8': + resolution: {integrity: sha512-7XJ9cPU+yI2QeLS+FCSlqNFZJq8arvswefkZrYI1yQBbftw6FyrZOxYSh+9S7z7TpeWlRt9zJ5IhM1WIL334jA==} + + '@floating-ui/dom@1.6.11': + resolution: {integrity: sha512-qkMCxSR24v2vGkhYDo/UzxfJN3D4syqSjyuTFz6C7XcpU1pASPRieNI0Kj5VP3/503mOfYiGY891ugBX1GlABQ==} + + '@floating-ui/utils@0.2.8': + resolution: {integrity: sha512-kym7SodPp8/wloecOpcmSnWJsK7M0E5Wg8UcFA+uO4B9s5d0ywXOEro/8HM9x0rW+TljRzul/14UYz3TleT3ig==} + '@humanwhocodes/config-array@0.11.14': resolution: {integrity: sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==} engines: {node: '>=10.10.0'} @@ -6383,6 +6395,17 @@ snapshots: fastq: 1.17.1 glob: 10.4.1 + '@floating-ui/core@1.6.8': + dependencies: + '@floating-ui/utils': 0.2.8 + + '@floating-ui/dom@1.6.11': + dependencies: + '@floating-ui/core': 1.6.8 + '@floating-ui/utils': 0.2.8 + + '@floating-ui/utils@0.2.8': {} + '@humanwhocodes/config-array@0.11.14': dependencies: '@humanwhocodes/object-schema': 2.0.3 diff --git a/svelte-app/src/components/code-block.svelte b/svelte-app/src/components/code-block.svelte index c829dc738..ffd80a76f 100644 --- a/svelte-app/src/components/code-block.svelte +++ b/svelte-app/src/components/code-block.svelte @@ -83,10 +83,11 @@
{#if filename}
{/if} - + - - diff --git a/svelte-app/src/components/document/content/header.svelte b/svelte-app/src/components/document/content/header.svelte index 71e81c29b..0178808ce 100644 --- a/svelte-app/src/components/document/content/header.svelte +++ b/svelte-app/src/components/document/content/header.svelte @@ -76,7 +76,7 @@ class="flex w-full flex-row flex-wrap justify-between gap-2 p-2 text-sm text-neutral-700 dark:text-neutral-100" >
- +

diff --git a/svelte-app/src/components/experiments/gol.svelte b/svelte-app/src/components/experiments/gol.svelte index 20108c0ac..4baf61642 100644 --- a/svelte-app/src/components/experiments/gol.svelte +++ b/svelte-app/src/components/experiments/gol.svelte @@ -136,7 +136,7 @@ - +