react-modern-audio-player 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +562 -0
- package/dist/index.css +1 -0
- package/dist/index.es.js +17516 -0
- package/dist/types/components/AudioPlayer/Audio/Basic.d.ts +2 -0
- package/dist/types/components/AudioPlayer/Audio/WaveSurfer.d.ts +2 -0
- package/dist/types/components/AudioPlayer/Audio/index.d.ts +2 -0
- package/dist/types/components/AudioPlayer/Audio/useBasicAudio.d.ts +2 -0
- package/dist/types/components/AudioPlayer/Audio/useWaveSurfer.d.ts +1 -0
- package/dist/types/components/AudioPlayer/Context/StateContext/audio.d.ts +24 -0
- package/dist/types/components/AudioPlayer/Context/StateContext/element.d.ts +45 -0
- package/dist/types/components/AudioPlayer/Context/StateContext/index.d.ts +20 -0
- package/dist/types/components/AudioPlayer/Context/StateContext/placement.d.ts +16 -0
- package/dist/types/components/AudioPlayer/Context/dispatchContext.d.ts +48 -0
- package/dist/types/components/AudioPlayer/Context/index.d.ts +3 -0
- package/dist/types/components/AudioPlayer/Context/reducer.d.ts +3 -0
- package/dist/types/components/AudioPlayer/Interface/Controller/Button/PlayBtn.d.ts +2 -0
- package/dist/types/components/AudioPlayer/Interface/Controller/Button/PlayListTriggerBtn.d.ts +5 -0
- package/dist/types/components/AudioPlayer/Interface/Controller/Button/PrevNnextBtn.d.ts +6 -0
- package/dist/types/components/AudioPlayer/Interface/Controller/Button/RepeatTypeBtn.d.ts +2 -0
- package/dist/types/components/AudioPlayer/Interface/Controller/Button/StyledBtn.d.ts +1 -0
- package/dist/types/components/AudioPlayer/Interface/Controller/Button/index.d.ts +4 -0
- package/dist/types/components/AudioPlayer/Interface/Controller/Drawer/SortablePlayList/Content/PlayListItem.d.ts +4 -0
- package/dist/types/components/AudioPlayer/Interface/Controller/Drawer/SortablePlayList/Content/index.d.ts +6 -0
- package/dist/types/components/AudioPlayer/Interface/Controller/Drawer/SortablePlayList/Content/usePlayList.d.ts +15 -0
- package/dist/types/components/AudioPlayer/Interface/Controller/Drawer/SortablePlayList/index.d.ts +2 -0
- package/dist/types/components/AudioPlayer/Interface/Controller/Drawer/index.d.ts +1 -0
- package/dist/types/components/AudioPlayer/Interface/Controller/Icon.d.ts +8 -0
- package/dist/types/components/AudioPlayer/Interface/Controller/Input/Progress/BarProgress.d.ts +2 -0
- package/dist/types/components/AudioPlayer/Interface/Controller/Input/Progress/WaveformProgress.d.ts +2 -0
- package/dist/types/components/AudioPlayer/Interface/Controller/Input/Progress/index.d.ts +2 -0
- package/dist/types/components/AudioPlayer/Interface/Controller/Input/Progress/useBarProgress.d.ts +2 -0
- package/dist/types/components/AudioPlayer/Interface/Controller/Input/index.d.ts +1 -0
- package/dist/types/components/AudioPlayer/Interface/Controller/Tooltip/Volume/Content.d.ts +5 -0
- package/dist/types/components/AudioPlayer/Interface/Controller/Tooltip/Volume/Trigger.d.ts +1 -0
- package/dist/types/components/AudioPlayer/Interface/Controller/Tooltip/Volume/index.d.ts +2 -0
- package/dist/types/components/AudioPlayer/Interface/Controller/Tooltip/index.d.ts +1 -0
- package/dist/types/components/AudioPlayer/Interface/Controller/index.d.ts +2 -0
- package/dist/types/components/AudioPlayer/Interface/Information/Artwork.d.ts +2 -0
- package/dist/types/components/AudioPlayer/Interface/Information/TrackInfo.d.ts +2 -0
- package/dist/types/components/AudioPlayer/Interface/Information/TrackTime.d.ts +3 -0
- package/dist/types/components/AudioPlayer/Interface/Information/index.d.ts +2 -0
- package/dist/types/components/AudioPlayer/Interface/index.d.ts +2 -0
- package/dist/types/components/AudioPlayer/Player.d.ts +13 -0
- package/dist/types/components/AudioPlayer/index.d.ts +4 -0
- package/dist/types/components/CssTransition.d.ts +13 -0
- package/dist/types/components/Drawer/Drawer.d.ts +20 -0
- package/dist/types/components/Drawer/DrawerContent.d.ts +7 -0
- package/dist/types/components/Drawer/DrawerContext.d.ts +6 -0
- package/dist/types/components/Drawer/DrawerTrigger.d.ts +2 -0
- package/dist/types/components/Drawer/index.d.ts +3 -0
- package/dist/types/components/Grid/Grid.d.ts +8 -0
- package/dist/types/components/Grid/Item.d.ts +2 -0
- package/dist/types/components/Grid/index.d.ts +2 -0
- package/dist/types/components/Provider/AudioPlayerProvider.d.ts +2 -0
- package/dist/types/components/Provider/SpectrumProvider.d.ts +7 -0
- package/dist/types/components/Provider/index.d.ts +2 -0
- package/dist/types/components/SortableList/SortableList.d.ts +8 -0
- package/dist/types/components/SortableList/SortableListItem.d.ts +5 -0
- package/dist/types/components/SortableList/index.d.ts +8 -0
- package/dist/types/components/SortableList/useSortableListItem.d.ts +12 -0
- package/dist/types/hooks/useNonNullableContext.d.ts +2 -0
- package/dist/types/hooks/useVariableColor.d.ts +2 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/styles/GlobalStyle.d.ts +1 -0
- package/dist/types/utils/generateGridTemplateValues.d.ts +5 -0
- package/dist/types/utils/generateUnionNumType.d.ts +6 -0
- package/dist/types/utils/getTime.d.ts +1 -0
- package/dist/types/utils/resetAudioValues.d.ts +9 -0
- package/package.json +53 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useWaveSurfer: () => null;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
export declare type AudioNativeProps = Omit<React.AudioHTMLAttributes<HTMLAudioElement>, "autoPlay">;
|
|
3
|
+
export declare type RepeatType = "ALL" | "SHUFFLE" | "ONE" | "NONE";
|
|
4
|
+
export declare type AudioCustomProps = {
|
|
5
|
+
isPlaying: boolean;
|
|
6
|
+
repeatType?: RepeatType;
|
|
7
|
+
volume: number;
|
|
8
|
+
currentTime?: number;
|
|
9
|
+
duration?: number;
|
|
10
|
+
};
|
|
11
|
+
export declare type AudioData = {
|
|
12
|
+
src: string;
|
|
13
|
+
id: number;
|
|
14
|
+
index: number;
|
|
15
|
+
name?: string | ReactNode;
|
|
16
|
+
writer?: string | ReactNode;
|
|
17
|
+
img?: string;
|
|
18
|
+
description?: string | ReactNode;
|
|
19
|
+
customTrackInfo?: string | ReactNode;
|
|
20
|
+
};
|
|
21
|
+
export declare type CurAudioState = AudioNativeProps & AudioCustomProps;
|
|
22
|
+
export declare type AudioInitialState = Partial<CurAudioState> & {
|
|
23
|
+
curPlayId: number;
|
|
24
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { AudioData } from "./audio";
|
|
3
|
+
export declare type PlayList = Array<AudioData>;
|
|
4
|
+
export declare type TrackTimeUI = "separation-mode" | "unification-mode" | false;
|
|
5
|
+
export declare type ProgressUI = "waveform" | "bar" | false;
|
|
6
|
+
export declare type PlayListUI = "sortable" | "unSortable" | false;
|
|
7
|
+
export declare type ActiveUI = Partial<{
|
|
8
|
+
all: boolean;
|
|
9
|
+
playButton: boolean;
|
|
10
|
+
playList: PlayListUI;
|
|
11
|
+
prevNnext: boolean;
|
|
12
|
+
volume: boolean;
|
|
13
|
+
repeatType: boolean;
|
|
14
|
+
trackTime: TrackTimeUI;
|
|
15
|
+
trackInfo: boolean;
|
|
16
|
+
artwork: boolean;
|
|
17
|
+
progress: ProgressUI;
|
|
18
|
+
}>;
|
|
19
|
+
export declare type CustomIcons = Partial<{
|
|
20
|
+
play: ReactNode;
|
|
21
|
+
pause: ReactNode;
|
|
22
|
+
prev: ReactNode;
|
|
23
|
+
next: ReactNode;
|
|
24
|
+
repeatOne: ReactNode;
|
|
25
|
+
repeatAll: ReactNode;
|
|
26
|
+
repeatNone: ReactNode;
|
|
27
|
+
repeatShuffle: ReactNode;
|
|
28
|
+
volumeFull: ReactNode;
|
|
29
|
+
volumeHalf: ReactNode;
|
|
30
|
+
volumeMuted: ReactNode;
|
|
31
|
+
playList: ReactNode;
|
|
32
|
+
}>;
|
|
33
|
+
export declare type ElementRefs = Partial<{
|
|
34
|
+
audioEl: HTMLAudioElement;
|
|
35
|
+
trackCurTimeEl: HTMLSpanElement;
|
|
36
|
+
trackDurationEl: HTMLSpanElement;
|
|
37
|
+
progressBarEl: HTMLDivElement;
|
|
38
|
+
progressValueEl: HTMLDivElement;
|
|
39
|
+
progressHandleEl: HTMLDivElement;
|
|
40
|
+
waveformInst: WaveSurfer;
|
|
41
|
+
}>;
|
|
42
|
+
export interface CoverImgsCss {
|
|
43
|
+
artwork?: React.CSSProperties;
|
|
44
|
+
listThumbnail?: React.CSSProperties;
|
|
45
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { CurAudioState } from "./audio";
|
|
2
|
+
import { ActiveUI, CoverImgsCss, ElementRefs, CustomIcons, PlayList } from "./element";
|
|
3
|
+
import { PlayListPlacement, InterfacePlacement, PlayerPlacement } from "./placement";
|
|
4
|
+
export interface AudioPlayerStateContext {
|
|
5
|
+
playList: PlayList;
|
|
6
|
+
curPlayId: number;
|
|
7
|
+
curIdx: number;
|
|
8
|
+
curAudioState: CurAudioState;
|
|
9
|
+
activeUI: ActiveUI;
|
|
10
|
+
playListPlacement: PlayListPlacement;
|
|
11
|
+
playerPlacement?: PlayerPlacement;
|
|
12
|
+
interfacePlacement?: InterfacePlacement;
|
|
13
|
+
elementRefs?: ElementRefs;
|
|
14
|
+
customIcons?: CustomIcons;
|
|
15
|
+
coverImgsCss?: CoverImgsCss;
|
|
16
|
+
}
|
|
17
|
+
export * from "./audio";
|
|
18
|
+
export * from "./element";
|
|
19
|
+
export * from "./placement";
|
|
20
|
+
export declare const audioPlayerStateContext: import("react").Context<AudioPlayerStateContext | null>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { NumbersToUnionNum } from '../../../../utils/generateUnionNumType';
|
|
2
|
+
import { ActiveUI } from "./element";
|
|
3
|
+
export declare type PlayListPlacement = "bottom" | "top";
|
|
4
|
+
export declare type PlayerPlacement = "bottom" | "top" | "bottom-left" | "bottom-right" | "top-left" | "top-right";
|
|
5
|
+
export declare const interfacePlacementMaxLength = 10;
|
|
6
|
+
declare type InterfacePlacementKey = Exclude<keyof ActiveUI, "all" | "prevNnext" | "trackTime"> | "trackTimeCurrent" | "trackTimeDuration";
|
|
7
|
+
export declare type InterfaceGridTemplateArea = Partial<Record<InterfacePlacementKey, `row${NumbersToUnionNum<typeof interfacePlacementMaxLength>}-${NumbersToUnionNum<typeof interfacePlacementMaxLength>}`>>;
|
|
8
|
+
export declare type InterfaceGridItemArea = Partial<Record<InterfacePlacementKey, string>>;
|
|
9
|
+
export declare type InterfacePlacement = {
|
|
10
|
+
templateArea: InterfaceGridTemplateArea;
|
|
11
|
+
itemArea?: InterfaceGridItemArea;
|
|
12
|
+
};
|
|
13
|
+
export declare const defaultInterfacePlacement: {
|
|
14
|
+
templateArea: Required<InterfaceGridTemplateArea>;
|
|
15
|
+
};
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Dispatch } from "react";
|
|
2
|
+
import { RepeatType, PlayList, PlayListPlacement, PlayerPlacement, ActiveUI, ElementRefs, CustomIcons, AudioInitialState, InterfacePlacement, CoverImgsCss } from "./StateContext";
|
|
3
|
+
export declare type AudioContextAction = {
|
|
4
|
+
type: "NEXT_AUDIO";
|
|
5
|
+
} | {
|
|
6
|
+
type: "PREV_AUDIO";
|
|
7
|
+
} | {
|
|
8
|
+
type: "UPDATE_PLAY_LIST";
|
|
9
|
+
playList: PlayList;
|
|
10
|
+
} | {
|
|
11
|
+
type: "SET_INITIAL_AUDIO_STATE";
|
|
12
|
+
audioInitialState: AudioInitialState;
|
|
13
|
+
} | {
|
|
14
|
+
type: "SET_PlAY_STATE";
|
|
15
|
+
state?: boolean;
|
|
16
|
+
} | {
|
|
17
|
+
type: "SET_CURRENT_INDEX";
|
|
18
|
+
currentIndex: number;
|
|
19
|
+
currentAudioId: number;
|
|
20
|
+
} | {
|
|
21
|
+
type: "SET_REPEAT_TYPE";
|
|
22
|
+
repeatType: RepeatType;
|
|
23
|
+
} | {
|
|
24
|
+
type: "SET_PLACEMENTS";
|
|
25
|
+
playerPlacement?: PlayerPlacement;
|
|
26
|
+
playListPlacement?: PlayListPlacement;
|
|
27
|
+
interfacePlacement?: InterfacePlacement;
|
|
28
|
+
} | {
|
|
29
|
+
type: "SET_VOLUME";
|
|
30
|
+
volume: number;
|
|
31
|
+
} | {
|
|
32
|
+
type: "SET_MUTED";
|
|
33
|
+
muted: boolean;
|
|
34
|
+
} | {
|
|
35
|
+
type: "SET_ACTIVE_UI";
|
|
36
|
+
activeUI: ActiveUI;
|
|
37
|
+
} | {
|
|
38
|
+
type: "SET_ELEMENT_REFS";
|
|
39
|
+
elementRefs: ElementRefs;
|
|
40
|
+
} | {
|
|
41
|
+
type: "SET_CUSTOM_ICONS";
|
|
42
|
+
customIcons: CustomIcons;
|
|
43
|
+
} | {
|
|
44
|
+
type: "SET_COVER_IMGS_CSS";
|
|
45
|
+
coverImgsCss: CoverImgsCss;
|
|
46
|
+
};
|
|
47
|
+
export declare type AudioPlayerDispatchContext = Dispatch<AudioContextAction>;
|
|
48
|
+
export declare const audioPlayerDispatchContext: import("react").Context<AudioPlayerDispatchContext | null>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const StyledBtn: import("styled-components").StyledComponent<"button", any, {}, never>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AudioData } from '../../../../../../AudioPlayer/Context';
|
|
2
|
+
import { CssTransitionProps } from '../../../../../../CssTransition';
|
|
3
|
+
import { UseSortableListItemProps } from '../../../../../../SortableList/useSortableListItem';
|
|
4
|
+
import { SortablePlayListProps } from ".";
|
|
5
|
+
interface UsePlayListReturn {
|
|
6
|
+
cssTransitionEventProps: Partial<CssTransitionProps>;
|
|
7
|
+
sortableItemEventProps: Omit<UseSortableListItemProps<AudioData>, "onDragStart" | "onClick" | "index" | "listData"> & {
|
|
8
|
+
onDragStart: (index: number) => void;
|
|
9
|
+
onClick: (index: number) => void;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export declare const usePlayList: ({ setIsOpen, }: {
|
|
13
|
+
setIsOpen: SortablePlayListProps["setIsOpen"];
|
|
14
|
+
}) => UsePlayListReturn;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./SortablePlayList";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Progress";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Trigger: import("react").ForwardRefExoticComponent<import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Volume";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import { ActiveUI, PlayListPlacement, CustomIcons, PlayerPlacement, PlayList, AudioInitialState, InterfacePlacement, CoverImgsCss } from '../AudioPlayer/Context';
|
|
3
|
+
export interface AudioPlayerProps {
|
|
4
|
+
playList: PlayList;
|
|
5
|
+
audioInitialState?: AudioInitialState;
|
|
6
|
+
playerPlacement?: PlayerPlacement;
|
|
7
|
+
playListPlacement?: PlayListPlacement;
|
|
8
|
+
interfacePlacement?: InterfacePlacement;
|
|
9
|
+
activeUI?: ActiveUI;
|
|
10
|
+
customIcons?: CustomIcons;
|
|
11
|
+
coverImgsCss?: CoverImgsCss;
|
|
12
|
+
}
|
|
13
|
+
export declare const AudioPlayer: FC<AudioPlayerProps>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FC, PropsWithChildren } from "react";
|
|
2
|
+
export declare const appearanceIn: import("styled-components").Keyframes;
|
|
3
|
+
export declare const appearanceOut: import("styled-components").Keyframes;
|
|
4
|
+
export interface CssTransitionProps {
|
|
5
|
+
visible: boolean;
|
|
6
|
+
name: string;
|
|
7
|
+
leaveTime: number;
|
|
8
|
+
enterTime: number;
|
|
9
|
+
clearTime: number;
|
|
10
|
+
onExited?: () => void;
|
|
11
|
+
onEntered?: () => void;
|
|
12
|
+
}
|
|
13
|
+
export declare const CssTransition: FC<PropsWithChildren<CssTransitionProps>>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { PlayerPlacement } from '../AudioPlayer/Context';
|
|
2
|
+
import { PropsWithChildren } from "react";
|
|
3
|
+
import { FC } from "react";
|
|
4
|
+
import { DrawerContext } from "./DrawerContext";
|
|
5
|
+
import { DrawerTrigger } from "./DrawerTrigger";
|
|
6
|
+
import { DrawerContent } from "./DrawerContent";
|
|
7
|
+
export interface DrawerProps extends Omit<Partial<DrawerContext>, "setIsOpen"> {
|
|
8
|
+
outboundClickActive?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare const Drawer: FC<PropsWithChildren<DrawerProps>>;
|
|
11
|
+
declare type DrawerComponent = typeof Drawer & {
|
|
12
|
+
Trigger: typeof DrawerTrigger;
|
|
13
|
+
Content: typeof DrawerContent;
|
|
14
|
+
};
|
|
15
|
+
declare const _default: DrawerComponent;
|
|
16
|
+
export default _default;
|
|
17
|
+
interface DrawerContainerProps {
|
|
18
|
+
playerPlacement?: PlayerPlacement;
|
|
19
|
+
}
|
|
20
|
+
export declare const DrawerContainer: import("styled-components").StyledComponent<"div", any, DrawerContainerProps, never>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FC, HTMLAttributes, PropsWithChildren } from "react";
|
|
2
|
+
export declare type DrawerContentPlacement = "top" | "bottom" | "left" | "right";
|
|
3
|
+
export declare type DrawerContentProps = HTMLAttributes<HTMLDivElement> & {
|
|
4
|
+
placement?: DrawerContentPlacement;
|
|
5
|
+
isWithAnimation?: boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare const DrawerContent: FC<PropsWithChildren<DrawerContentProps>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Grid as SpectrumGrid } from "@react-spectrum/layout";
|
|
2
|
+
import { GridItem } from "./Item";
|
|
3
|
+
export declare const Grid: import("react").ForwardRefExoticComponent<import("@react-types/layout").GridProps & import("react").RefAttributes<import("@react-types/shared").DOMRefValue<HTMLDivElement>>>;
|
|
4
|
+
declare type GridComponent = typeof SpectrumGrid & {
|
|
5
|
+
Item: typeof GridItem;
|
|
6
|
+
};
|
|
7
|
+
declare const _default: GridComponent;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FC, PropsWithChildren } from "react";
|
|
2
|
+
import { DOMRefValue } from "@react-types/shared";
|
|
3
|
+
import { ProviderProps } from "@react-types/provider";
|
|
4
|
+
export interface SpectrumProviderProps {
|
|
5
|
+
rootContainerProps?: Omit<ProviderProps & React.RefAttributes<DOMRefValue<HTMLDivElement>>, "children">;
|
|
6
|
+
}
|
|
7
|
+
export declare const SpectrumProvider: FC<PropsWithChildren<SpectrumProviderProps>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FC, PropsWithChildren } from "react";
|
|
2
|
+
import { SortableListItem } from "./SortableListItem";
|
|
3
|
+
declare const SortableList: FC<PropsWithChildren<unknown>>;
|
|
4
|
+
declare type SortableListComponent = typeof SortableList & {
|
|
5
|
+
Item: typeof SortableListItem;
|
|
6
|
+
};
|
|
7
|
+
declare const _default: SortableListComponent;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { PropsWithChildren } from "react";
|
|
2
|
+
import { ListItem } from "./index";
|
|
3
|
+
import { UseSortableListItemProps } from "./useSortableListItem";
|
|
4
|
+
export declare type SortableListItemProps<T> = UseSortableListItemProps<T>;
|
|
5
|
+
export declare const SortableListItem: <T extends ListItem>(props: PropsWithChildren<SortableListItemProps<T>>) => JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import SortableList from "./SortableList";
|
|
2
|
+
export default SortableList;
|
|
3
|
+
export declare type ListData<T> = Array<T>;
|
|
4
|
+
export declare type ListItem = Record<string, any> & {
|
|
5
|
+
index: number;
|
|
6
|
+
};
|
|
7
|
+
export type { UseSortableListItemProps } from "./useSortableListItem";
|
|
8
|
+
export type { SortableListItemProps } from "./SortableListItem";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ListData } from "./index";
|
|
2
|
+
export interface UseSortableListItemProps<T> {
|
|
3
|
+
index: number;
|
|
4
|
+
dragStartIdx: number;
|
|
5
|
+
listData: ListData<T>;
|
|
6
|
+
draggable?: boolean;
|
|
7
|
+
onDragStart?: (e: React.DragEvent<HTMLLIElement>) => void;
|
|
8
|
+
onDragOver?: (e: React.DragEvent<HTMLLIElement>) => void;
|
|
9
|
+
onDrop?: (e: React.DragEvent<HTMLLIElement>, newListData: ListData<T>) => void;
|
|
10
|
+
onClick?: (e: React.MouseEvent<HTMLLIElement>) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare const useSortableListItem: <T>(props: UseSortableListItemProps<T>) => React.LiHTMLAttributes<HTMLLIElement>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const GlobalStyle: import("styled-components").GlobalStyleComponent<{}, import("styled-components").DefaultTheme>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ActiveUI } from '../components/AudioPlayer/Context/StateContext';
|
|
2
|
+
export declare const generateGridTemplateValues: (activeUi: ActiveUI, placement?: Partial<Record<"progress" | "playButton" | "playList" | "volume" | "repeatType" | "trackInfo" | "artwork" | "trackTimeCurrent" | "trackTimeDuration", "row1-1" | "row1-2" | "row1-3" | "row1-4" | "row1-5" | "row1-6" | "row1-7" | "row1-8" | "row1-9" | "row2-1" | "row2-2" | "row2-3" | "row2-4" | "row2-5" | "row2-6" | "row2-7" | "row2-8" | "row2-9" | "row3-1" | "row3-2" | "row3-3" | "row3-4" | "row3-5" | "row3-6" | "row3-7" | "row3-8" | "row3-9" | "row4-1" | "row4-2" | "row4-3" | "row4-4" | "row4-5" | "row4-6" | "row4-7" | "row4-8" | "row4-9" | "row5-1" | "row5-2" | "row5-3" | "row5-4" | "row5-5" | "row5-6" | "row5-7" | "row5-8" | "row5-9" | "row6-1" | "row6-2" | "row6-3" | "row6-4" | "row6-5" | "row6-6" | "row6-7" | "row6-8" | "row6-9" | "row7-1" | "row7-2" | "row7-3" | "row7-4" | "row7-5" | "row7-6" | "row7-7" | "row7-8" | "row7-9" | "row8-1" | "row8-2" | "row8-3" | "row8-4" | "row8-5" | "row8-6" | "row8-7" | "row8-8" | "row8-9" | "row9-1" | "row9-2" | "row9-3" | "row9-4" | "row9-5" | "row9-6" | "row9-7" | "row9-8" | "row9-9">> | undefined) => {
|
|
3
|
+
gridAreas: string[];
|
|
4
|
+
gridColumns: string[];
|
|
5
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
declare type _GenerateUnionNum<Length extends number, Counter extends number[], Accumulator extends number> = Counter["length"] extends Length ? Accumulator : _GenerateUnionNum<Length, [
|
|
2
|
+
number,
|
|
3
|
+
...Counter
|
|
4
|
+
], Accumulator | Counter["length"]>;
|
|
5
|
+
export declare type NumbersToUnionNum<Num extends number> = Num extends number ? Num extends 0 ? never : Exclude<_GenerateUnionNum<Num, [], 0>, 0> : never;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getTimeWithPadStart: (time: number) => string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const resetAudioValues: (elementRefs?: Partial<{
|
|
2
|
+
audioEl: HTMLAudioElement;
|
|
3
|
+
trackCurTimeEl: HTMLSpanElement;
|
|
4
|
+
trackDurationEl: HTMLSpanElement;
|
|
5
|
+
progressBarEl: HTMLDivElement;
|
|
6
|
+
progressValueEl: HTMLDivElement;
|
|
7
|
+
progressHandleEl: HTMLDivElement;
|
|
8
|
+
waveformInst: import("wavesurfer.js");
|
|
9
|
+
}> | undefined, duration?: number | undefined, restart?: boolean | undefined) => void;
|
package/package.json
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "react-modern-audio-player",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"homepage": "https://github.com/slash9494/react-modern-audio-player/",
|
|
5
|
+
"module": "dist/index.es.js",
|
|
6
|
+
"main": "dist/index.cjs",
|
|
7
|
+
"esnext": "dist/index.es.js",
|
|
8
|
+
"typings": "dist/types/index.d.ts",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist"
|
|
11
|
+
],
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"import": "./dist/index.es.js",
|
|
15
|
+
"require": "./dist/index.cjs"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git+https://github.com/slash9494/react-modern-audio-player.git"
|
|
21
|
+
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"dev": "vite --host",
|
|
24
|
+
"build": "rm -rf dist && tsc && vite build",
|
|
25
|
+
"preview": "vite preview",
|
|
26
|
+
"publish": "rm -rf dist && tsc && vite build"
|
|
27
|
+
},
|
|
28
|
+
"peerDependencies": {},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@react-spectrum/button": "^3.8.1",
|
|
31
|
+
"@react-spectrum/layout": "^3.3.1",
|
|
32
|
+
"@react-spectrum/provider": "^3.4.1",
|
|
33
|
+
"@react-spectrum/theme-default": "^3.3.1",
|
|
34
|
+
"@react-spectrum/tooltip": "^3.2.1",
|
|
35
|
+
"@react-spectrum/view": "^3.2.1",
|
|
36
|
+
"@types/styled-components": "^5.1.25",
|
|
37
|
+
"@types/wavesurfer.js": "^6.0.3",
|
|
38
|
+
"classnames": "^2.3.1",
|
|
39
|
+
"react-icons": "^4.4.0",
|
|
40
|
+
"styled-components": "^5.3.5",
|
|
41
|
+
"wavesurfer.js": "^6.2.0"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@types/node": "^17.0.25",
|
|
45
|
+
"@types/react": "^18.0.1",
|
|
46
|
+
"@types/react-dom": "^18.0.0",
|
|
47
|
+
"@vitejs/plugin-react": "^1.0.7",
|
|
48
|
+
"typescript": "^4.6.3",
|
|
49
|
+
"vite": "^2.9.0",
|
|
50
|
+
"vite-plugin-dts": "^1.1.0",
|
|
51
|
+
"vite-plugin-libcss": "^1.0.5"
|
|
52
|
+
}
|
|
53
|
+
}
|