fix(react): rename MediaGesture and MediaHotkey to Gesture and Hotkey (#1374)

This commit is contained in:
rahim
2026-04-19 23:46:46 -07:00
committed by GitHub
parent 000c54e16a
commit 5e9a02c851
8 changed files with 81 additions and 61 deletions
@@ -14,7 +14,7 @@ import { useEffect } from 'react';
import { useContainer, usePlayer } from '../../player/context';
export interface MediaGestureProps {
export interface GestureProps {
type: 'tap' | 'doubletap' | (string & {});
action: GestureActionName | (string & {});
value?: number;
@@ -23,7 +23,7 @@ export interface MediaGestureProps {
disabled?: boolean;
}
export function MediaGesture({ type, action, value, pointer, region, disabled }: MediaGestureProps): ReactNode {
export function Gesture({ type, action, value, pointer, region, disabled }: GestureProps): ReactNode {
const store = usePlayer() as AnyPlayerStore;
const container = useContainer();
@@ -48,3 +48,13 @@ export function MediaGesture({ type, action, value, pointer, region, disabled }:
return null;
}
export namespace Gesture {
export type Props = GestureProps;
}
/** @deprecated Use `GestureProps` instead. */
export type MediaGestureProps = GestureProps;
/** @deprecated Use `Gesture` instead. */
export const MediaGesture = Gesture;
@@ -12,7 +12,7 @@ import { useEffect } from 'react';
import { useContainer, usePlayer } from '../../player/context';
export interface MediaHotkeyProps {
export interface HotkeyProps {
keys: string;
action: HotkeyActionName | (string & {});
value?: number;
@@ -20,7 +20,7 @@ export interface MediaHotkeyProps {
target?: 'player' | 'document';
}
export function MediaHotkey({ keys, action, value, disabled, target }: MediaHotkeyProps): ReactNode {
export function Hotkey({ keys, action, value, disabled, target }: HotkeyProps): ReactNode {
const store = usePlayer() as AnyPlayerStore;
const container = useContainer();
@@ -44,3 +44,13 @@ export function MediaHotkey({ keys, action, value, disabled, target }: MediaHotk
return null;
}
export namespace Hotkey {
export type Props = HotkeyProps;
}
/** @deprecated Use `HotkeyProps` instead. */
export type MediaHotkeyProps = HotkeyProps;
/** @deprecated Use `Hotkey` instead. */
export const MediaHotkey = Hotkey;