From 4272c2a8da13970f3948f40f63db7aae5d4a5907 Mon Sep 17 00:00:00 2001 From: Jannik Zschiesche Date: Tue, 7 May 2024 12:34:30 +0200 Subject: [PATCH 1/4] Deprecate matchMediaQuery() --- CHANGELOG.md | 6 ++++++ UPGRADE.md | 1 + src/media-query.ts | 2 ++ 3 files changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f582ec..993f098 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +2.2.2 +===== + +* (deprecation) Deprecate `matchMediaQuery()`, use `window.matchMedia()` directly. + + 2.2.1 ===== diff --git a/UPGRADE.md b/UPGRADE.md index f38a104..047ef9e 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -2,6 +2,7 @@ ========== * The `createEvent` helper was removed, use `new CustomEvent()` directly. +* Removed `matchMediaQuery()`, use `window.matchMedia()` directly. 1.x to 2.0 diff --git a/src/media-query.ts b/src/media-query.ts index 76e9374..81da858 100644 --- a/src/media-query.ts +++ b/src/media-query.ts @@ -11,6 +11,8 @@ export interface MediaQueryMatcher /** * Creates a new media query matcher + * + * @deprecated just use `matchMedia` directly. */ export function matchMediaQuery (query: string): MediaQueryMatcher { From bfa0b6c4f5fedb7ae4fecf9e9fde04d839d88240 Mon Sep 17 00:00:00 2001 From: Jannik Zschiesche Date: Tue, 7 May 2024 12:35:26 +0200 Subject: [PATCH 2/4] Deprecate `addConsecutiveClasses()` --- CHANGELOG.md | 1 + UPGRADE.md | 1 + src/animation.ts | 2 ++ 3 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 993f098..22b4f1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ===== * (deprecation) Deprecate `matchMediaQuery()`, use `window.matchMedia()` directly. +* (deprecation) Deprecate `addConsecutiveClasses()`, use Framer Motion or a different animation library instead. 2.2.1 diff --git a/UPGRADE.md b/UPGRADE.md index 047ef9e..ce3001a 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -3,6 +3,7 @@ * The `createEvent` helper was removed, use `new CustomEvent()` directly. * Removed `matchMediaQuery()`, use `window.matchMedia()` directly. +* Removed `addConsecutiveClasses()`, use Framer Motion or a different animation library instead. 1.x to 2.0 diff --git a/src/animation.ts b/src/animation.ts index f116562..1abb106 100644 --- a/src/animation.ts +++ b/src/animation.ts @@ -1,5 +1,7 @@ /** * Adds two classes in consecutive animation frames. + * + * @deprecated use Framer Motion or a different animation library instead */ export function addConsecutiveClasses ( element: HTMLElement, From df6f88eb37a9280871f7e28436374bbebee74c05 Mon Sep 17 00:00:00 2001 From: Jannik Zschiesche Date: Tue, 7 May 2024 12:44:59 +0200 Subject: [PATCH 3/4] CS --- src/popup-interaction.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/popup-interaction.ts b/src/popup-interaction.ts index 7cd0af3..c40282a 100644 --- a/src/popup-interaction.ts +++ b/src/popup-interaction.ts @@ -12,7 +12,10 @@ export interface DismissibleContainerDirector { * * Returns a callback to remove the listener. */ -export function registerBodyClickHandler (allowedClickTargets: HTMLElement[], onInvalidTargetClick: () => void) : () => void +export function registerBodyClickHandler ( + allowedClickTargets: HTMLElement[], + onInvalidTargetClick: () => void, +) : () => void { let handler = (event: Event) => { for (let i = 0; i < allowedClickTargets.length; i++) From b9b39f42fdd0bc50813e2be7e55c0c3b7231d8be Mon Sep 17 00:00:00 2001 From: Jannik Zschiesche Date: Tue, 7 May 2024 13:04:59 +0200 Subject: [PATCH 4/4] Add comment about what the callback does --- src/popup-interaction.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/popup-interaction.ts b/src/popup-interaction.ts index c40282a..c10a306 100644 --- a/src/popup-interaction.ts +++ b/src/popup-interaction.ts @@ -2,6 +2,9 @@ import {off, on} from './dom/events'; import {isChildOf} from './dom/traverse'; export interface DismissibleContainerDirector { + /** + * Close function + */ (): void; destroy(): void; }