From bf4f4dea26447121a859eca209746f81c6c1c1f8 Mon Sep 17 00:00:00 2001 From: Kieran Boyle Date: Tue, 12 Sep 2023 08:23:47 -0700 Subject: [PATCH 1/6] fix(empty-state): add content check to prevent empty tooltips from appearing. --- docs/package-lock.json | 18 +++++++++++------- package-lock.json | 4 ++-- package.json | 2 +- src/tooltip.svelte | 30 +++++++++++++++++------------- 4 files changed, 31 insertions(+), 23 deletions(-) diff --git a/docs/package-lock.json b/docs/package-lock.json index 62fa543..e65b720 100644 --- a/docs/package-lock.json +++ b/docs/package-lock.json @@ -18,7 +18,7 @@ }, "..": { "name": "@svelte-plugins/tooltips", - "version": "0.1.6", + "version": "0.1.7", "dev": true, "license": "MIT", "devDependencies": { @@ -299,9 +299,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001380", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001380.tgz", - "integrity": "sha512-OO+pPubxx16lkI7TVrbFpde8XHz66SMwstl1YWpg6uMGw56XnhYVwtPIjvX4kYpzwMwQKr4DDce394E03dQPGg==", + "version": "1.0.30001533", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001533.tgz", + "integrity": "sha512-9aY/b05NKU4Yl2sbcJhn4A7MsGwR1EPfW/nrqsnqVA0Oq50wpmPaGI+R1Z0UKlUl96oxUkGEOILWtOHck0eCWw==", "dev": true, "funding": [ { @@ -311,6 +311,10 @@ { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" } ] }, @@ -1736,9 +1740,9 @@ } }, "caniuse-lite": { - "version": "1.0.30001380", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001380.tgz", - "integrity": "sha512-OO+pPubxx16lkI7TVrbFpde8XHz66SMwstl1YWpg6uMGw56XnhYVwtPIjvX4kYpzwMwQKr4DDce394E03dQPGg==", + "version": "1.0.30001533", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001533.tgz", + "integrity": "sha512-9aY/b05NKU4Yl2sbcJhn4A7MsGwR1EPfW/nrqsnqVA0Oq50wpmPaGI+R1Z0UKlUl96oxUkGEOILWtOHck0eCWw==", "dev": true }, "chokidar": { diff --git a/package-lock.json b/package-lock.json index c555d5b..3bb415c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@svelte-plugins/tooltips", - "version": "0.1.5", + "version": "0.1.6", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@svelte-plugins/tooltips", - "version": "0.1.5", + "version": "0.1.6", "license": "MIT", "devDependencies": { "@babel/core": "^7.13.1", diff --git a/package.json b/package.json index 0b450dc..ee92d26 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@svelte-plugins/tooltips", - "version": "0.1.6", + "version": "0.1.7", "license": "MIT", "description": "A simple tooltip action and component designed for Svelte.", "author": "Kieran Boyle (https://github.com/dysfunc)", diff --git a/src/tooltip.svelte b/src/tooltip.svelte index 4919fb2..2137f42 100644 --- a/src/tooltip.svelte +++ b/src/tooltip.svelte @@ -89,20 +89,24 @@ $: isComponent = typeof content === 'object'; - +{#if content} + + +
+ {#if !isComponent} + {@html content} + {/if} +
+
+{:else} -
- {#if !isComponent} - {@html content} - {/if} -
-
+{/if}