From 8b8c0f4ae5ed537a5bdc5cac852ced814015cc77 Mon Sep 17 00:00:00 2001 From: Kieran Boyle Date: Wed, 21 Feb 2024 20:06:43 -0800 Subject: [PATCH 1/5] chore(readme): fix typo in prop defs --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 22f88bb..5892aa6 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ Checkout out my tooltip | autoPosition | Adjust tooltip position if viewport clipping occurs | `boolean` (default: `false`) | | content | The string or object containing componentref and props | `string` | `object` component (default: ``) | | delay | The animation delay in milliseconds to apply to the tooltip | `number` (default: `200`) | -| hideOnOutsideClick | Hides a tooltip when an outside click occurs | `boolean` (default: `false`) | +| hideOnClickOutside | Hides a tooltip when an outside click occurs | `boolean` (default: `false`) | | maxWidth | The max allowable width of the tooltip content | `number` (default: `200`) | | position | The position where the tooltip should appear relative to its parent | `string` (default: `top`) | | show | Allows you to manually control the tooltip visibility | `boolean` (default: `false`) | From 50140ae6732371a3dd83b6ef4bf6121ba97bbf59 Mon Sep 17 00:00:00 2001 From: Beqa Date: Wed, 20 Mar 2024 14:22:16 +0400 Subject: [PATCH 2/5] Docs: Instruct to install as a project dep instead of dev dep. --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5892aa6..422730b 100644 --- a/README.md +++ b/README.md @@ -7,15 +7,15 @@ Try it in the [Svelte REPL](https://svelte.dev/repl/e63e262a91834400aa567b9b0d20 ## Install ```bash -yarn add -D @svelte-plugins/tooltips +yarn add @svelte-plugins/tooltips # or with NPM -npm i -D @svelte-plugins/tooltips +npm i @svelte-plugins/tooltips # or with PNPM -pnpm i -D @svelte-plugins/tooltips +pnpm i @svelte-plugins/tooltips ``` ## Using the Tooltip component From d0b12952a1d5c4824358d7045cefd2e720524128 Mon Sep 17 00:00:00 2001 From: Kieran Boyle Date: Sat, 30 Dec 2023 11:26:39 -0800 Subject: [PATCH 3/5] chore(package.json): normalize url for repo --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 569ea5a..0c4050f 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ ], "repository": { "type": "git", - "url": "https://github.com/svelte-plugins/tooltips.git" + "url": "git+https://github.com/svelte-plugins/tooltips.git" }, "files": [ "dist", From 2801113a01f30b2165b3194655043bb17a3b5437 Mon Sep 17 00:00:00 2001 From: Kieran Boyle Date: Sun, 28 Apr 2024 08:44:22 -0700 Subject: [PATCH 4/5] chore(release): release vesion 3.0.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0c4050f..1c7821e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@svelte-plugins/tooltips", - "version": "3.0.0", + "version": "3.0.1", "license": "MIT", "description": "A simple tooltip action and component designed for Svelte.", "author": "Kieran Boyle (https://github.com/dysfunc)", From 9ad91adb072ad38f4a1a72f27606017800bb38e1 Mon Sep 17 00:00:00 2001 From: Kieran Boyle Date: Sun, 28 Apr 2024 08:44:52 -0700 Subject: [PATCH 5/5] fix(typescript): change action to optional --- src/action-tooltip.d.ts | 2 +- src/helpers.js | 6 ------ src/tooltip.d.ts | 2 +- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/action-tooltip.d.ts b/src/action-tooltip.d.ts index 4e5c84d..31917dc 100644 --- a/src/action-tooltip.d.ts +++ b/src/action-tooltip.d.ts @@ -5,7 +5,7 @@ export interface TooltipActionProps { * The action to trigger the tooltip * @default 'hover' */ - action: 'hover' | 'click' | 'prop' | string; + action?: 'hover' | 'click' | 'prop' | string; /** * The alignment of the tooltip. diff --git a/src/helpers.js b/src/helpers.js index c3c2cff..bb31383 100644 --- a/src/helpers.js +++ b/src/helpers.js @@ -85,12 +85,6 @@ export const computeTooltipPosition = ( const elementPosition = computedStyle.position; const currentRect = currentElement.getBoundingClientRect(); - // if (elementPosition === 'static') { - // currentElement = currentElement.parentElement; - // continue; - // } - - // console.log() if (elementPosition === 'fixed') { fixedOffsetTop += currentRect.top + window.scrollY; diff --git a/src/tooltip.d.ts b/src/tooltip.d.ts index d2db619..f756887 100644 --- a/src/tooltip.d.ts +++ b/src/tooltip.d.ts @@ -5,7 +5,7 @@ export interface TooltipProps { * The action to trigger the tooltip * @default 'hover' */ - action: 'hover' | 'click' | 'prop' | string; + action?: 'hover' | 'click' | 'prop' | string; /** * The alignment of the tooltip.