@applemusic-like-lyrics/react-full 0.2.0-alpha.0
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/LICENSE +661 -0
- package/README.md +5 -0
- package/dist/amll-react-framework.cjs +64 -0
- package/dist/amll-react-framework.cjs.map +1 -0
- package/dist/amll-react-framework.js +6842 -0
- package/dist/amll-react-framework.js.map +1 -0
- package/dist/components/AudioFFTVisualizer/index.d.ts +4 -0
- package/dist/components/AudioQualityTag/index.d.ts +5 -0
- package/dist/components/BouncingSlider/index.d.ts +13 -0
- package/dist/components/ControlThumb/index.d.ts +4 -0
- package/dist/components/Cover/index.d.ts +11 -0
- package/dist/components/MediaButton/index.d.ts +2 -0
- package/dist/components/MenuButton/index.d.ts +2 -0
- package/dist/components/MusicInfo/index.d.ts +9 -0
- package/dist/components/PrebuiltLyricPlayer/index.d.ts +5 -0
- package/dist/components/TextMarquee/index.d.ts +2 -0
- package/dist/components/ToggleIconButton/index.d.ts +11 -0
- package/dist/components/ToggleIconButton/prebuilt-enum.d.ts +8 -0
- package/dist/components/VolumeControlSlider/index.d.ts +2 -0
- package/dist/components/index.d.ts +13 -0
- package/dist/index.d.ts +4 -0
- package/dist/layout/auto.d.ts +16 -0
- package/dist/layout/horizontal.d.ts +11 -0
- package/dist/layout/index.d.ts +3 -0
- package/dist/layout/vertical.d.ts +10 -0
- package/dist/states/callback.d.ts +80 -0
- package/dist/states/config.d.ts +130 -0
- package/dist/states/index.d.ts +3 -0
- package/dist/states/music.d.ts +105 -0
- package/dist/utils/duration.d.ts +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/spring.d.ts +25 -0
- package/package.json +78 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { HTMLProps } from 'react';
|
|
2
|
+
export interface SliderProps {
|
|
3
|
+
onAfterChange?: (v: number) => void;
|
|
4
|
+
onBeforeChange?: () => void;
|
|
5
|
+
onChange?: (v: number) => void;
|
|
6
|
+
onSeeking?: (v: boolean) => void;
|
|
7
|
+
value: number;
|
|
8
|
+
min: number;
|
|
9
|
+
max: number;
|
|
10
|
+
beforeIcon?: JSX.Element;
|
|
11
|
+
afterIcon?: JSX.Element;
|
|
12
|
+
}
|
|
13
|
+
export declare const BouncingSlider: React.FC<SliderProps & Omit<HTMLProps<HTMLDivElement>, keyof SliderProps>>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { HTMLProps } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* 一个专辑图组件
|
|
4
|
+
*/
|
|
5
|
+
export declare const Cover: import('react').ForwardRefExoticComponent<Omit<{
|
|
6
|
+
coverUrl?: string;
|
|
7
|
+
coverIsVideo?: boolean;
|
|
8
|
+
coverVideoPaused?: boolean;
|
|
9
|
+
musicPaused?: boolean;
|
|
10
|
+
pauseShrinkAspect?: number;
|
|
11
|
+
} & HTMLProps<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement | null>>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { HTMLProps } from 'react';
|
|
2
|
+
export declare const MusicInfo: React.FC<{
|
|
3
|
+
name?: string;
|
|
4
|
+
artists?: string[];
|
|
5
|
+
album?: string;
|
|
6
|
+
onArtistClicked?: (artist: string, index: number) => void;
|
|
7
|
+
onAlbumClicked?: () => void;
|
|
8
|
+
onMenuButtonClicked?: () => void;
|
|
9
|
+
} & HTMLProps<HTMLDivElement>>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FC, HTMLProps, ReactNode } from 'react';
|
|
2
|
+
import { PrebuiltToggleIconButtonType } from './prebuilt-enum';
|
|
3
|
+
export declare const ToggleIconButton: FC<{
|
|
4
|
+
uncheckedIcon: ReactNode;
|
|
5
|
+
checkedIcon: ReactNode;
|
|
6
|
+
checked?: boolean;
|
|
7
|
+
} & Omit<HTMLProps<HTMLButtonElement>, "type">>;
|
|
8
|
+
export declare const PrebuiltToggleIconButton: FC<{
|
|
9
|
+
type: PrebuiltToggleIconButtonType;
|
|
10
|
+
checked?: boolean;
|
|
11
|
+
} & Omit<HTMLProps<HTMLButtonElement>, "type">>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from './AudioFFTVisualizer';
|
|
2
|
+
export * from './AudioQualityTag';
|
|
3
|
+
export * from './BouncingSlider';
|
|
4
|
+
export * from './ControlThumb';
|
|
5
|
+
export * from './Cover';
|
|
6
|
+
export * from './MediaButton';
|
|
7
|
+
export * from './MenuButton';
|
|
8
|
+
export * from './MusicInfo';
|
|
9
|
+
export * from './PrebuiltLyricPlayer';
|
|
10
|
+
export * from './TextMarquee';
|
|
11
|
+
export * from './ToggleIconButton';
|
|
12
|
+
export * from './ToggleIconButton/prebuilt-enum';
|
|
13
|
+
export * from './VolumeControlSlider';
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { HTMLProps } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* 会根据当前元素的宽高比自动选择横向或者纵向布局的组件
|
|
4
|
+
*/
|
|
5
|
+
export declare const AutoLyricLayout: React.FC<{
|
|
6
|
+
thumbSlot?: React.ReactNode;
|
|
7
|
+
controlsSlot?: React.ReactNode;
|
|
8
|
+
horizontalBottomControls?: React.ReactNode;
|
|
9
|
+
smallControlsSlot?: React.ReactNode;
|
|
10
|
+
bigControlsSlot?: React.ReactNode;
|
|
11
|
+
coverSlot?: React.ReactNode;
|
|
12
|
+
lyricSlot?: React.ReactNode;
|
|
13
|
+
backgroundSlot?: React.ReactNode;
|
|
14
|
+
hideLyric?: boolean;
|
|
15
|
+
onLayoutChange?: (isVertical: boolean) => void;
|
|
16
|
+
} & HTMLProps<HTMLDivElement>>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { HTMLProps } from 'react';
|
|
2
|
+
export declare const HorizontalLayout: React.FC<{
|
|
3
|
+
thumbSlot?: React.ReactNode;
|
|
4
|
+
coverSlot?: React.ReactNode;
|
|
5
|
+
controlsSlot?: React.ReactNode;
|
|
6
|
+
lyricSlot?: React.ReactNode;
|
|
7
|
+
backgroundSlot?: React.ReactNode;
|
|
8
|
+
bottomControls?: React.ReactNode;
|
|
9
|
+
hideLyric?: boolean;
|
|
10
|
+
asChild?: boolean;
|
|
11
|
+
} & HTMLProps<HTMLDivElement>>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { HTMLProps } from 'react';
|
|
2
|
+
export declare const VerticalLayout: React.FC<{
|
|
3
|
+
thumbSlot?: React.ReactNode;
|
|
4
|
+
smallControlsSlot?: React.ReactNode;
|
|
5
|
+
bigControlsSlot?: React.ReactNode;
|
|
6
|
+
coverSlot?: React.ReactNode;
|
|
7
|
+
lyricSlot?: React.ReactNode;
|
|
8
|
+
asChild?: boolean;
|
|
9
|
+
hideLyric?: boolean;
|
|
10
|
+
} & HTMLProps<HTMLDivElement>>;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { LyricLineMouseEvent } from '@applemusic-like-lyrics/core';
|
|
2
|
+
export interface Callback<Args extends any[], Result = void> {
|
|
3
|
+
onEmit?: (...args: Args) => Result;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* 当点击歌曲专辑图上方的控制横条按钮时触发的回调函数
|
|
7
|
+
*/
|
|
8
|
+
export declare const onClickControlThumbAtom: import('jotai').PrimitiveAtom<Callback<[], void>> & {
|
|
9
|
+
init: Callback<[], void>;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* 当任意企图打开菜单或点击菜单按钮时触发的回调函数
|
|
13
|
+
*/
|
|
14
|
+
export declare const onRequestOpenMenuAtom: import('jotai').PrimitiveAtom<Callback<[], void>> & {
|
|
15
|
+
init: Callback<[], void>;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* 当触发播放或恢复播放时触发的回调函数
|
|
19
|
+
*/
|
|
20
|
+
export declare const onPlayOrResumeAtom: import('jotai').PrimitiveAtom<Callback<[], void>> & {
|
|
21
|
+
init: Callback<[], void>;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* 当触发暂停播放时触发的回调函数
|
|
25
|
+
*/
|
|
26
|
+
export declare const onPauseAtom: import('jotai').PrimitiveAtom<Callback<[], void>> & {
|
|
27
|
+
init: Callback<[], void>;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* 当触发上一首歌曲时触发的回调函数
|
|
31
|
+
*/
|
|
32
|
+
export declare const onRequestPrevSongAtom: import('jotai').PrimitiveAtom<Callback<[], void>> & {
|
|
33
|
+
init: Callback<[], void>;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* 当触发下一首歌曲时触发的回调函数
|
|
37
|
+
*/
|
|
38
|
+
export declare const onRequestNextSongAtom: import('jotai').PrimitiveAtom<Callback<[], void>> & {
|
|
39
|
+
init: Callback<[], void>;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* 当触发设置歌曲播放位置时触发的回调函数
|
|
43
|
+
* @param _position 播放位置,单位为毫秒
|
|
44
|
+
*/
|
|
45
|
+
export declare const onSeekPositionAtom: import('jotai').PrimitiveAtom<Callback<[_position: number], void>> & {
|
|
46
|
+
init: Callback<[_position: number], void>;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* 当点击歌词行时触发的回调函数
|
|
50
|
+
* @param _evt 对应的歌词行事件对象
|
|
51
|
+
*/
|
|
52
|
+
export declare const onLyricLineClickAtom: import('jotai').PrimitiveAtom<Callback<[line: LyricLineMouseEvent], void>> & {
|
|
53
|
+
init: Callback<[line: LyricLineMouseEvent], void>;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* 当试图对歌词行打开上下文菜单(例如右键点击)时触发的回调函数
|
|
57
|
+
* @param _evt 对应的歌词行事件对象
|
|
58
|
+
*/
|
|
59
|
+
export declare const onLyricLineContextMenuAtom: import('jotai').PrimitiveAtom<Callback<[line: LyricLineMouseEvent], void>> & {
|
|
60
|
+
init: Callback<[line: LyricLineMouseEvent], void>;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* 当触发设置音量大小时触发的回调函数
|
|
64
|
+
* @param _volume 音量大小,取值范围为 [0-1]
|
|
65
|
+
*/
|
|
66
|
+
export declare const onChangeVolumeAtom: import('jotai').PrimitiveAtom<Callback<[_volume: number], void>> & {
|
|
67
|
+
init: Callback<[_volume: number], void>;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* 当点击位于控制按钮左侧的按钮时触发的回调函数
|
|
71
|
+
*/
|
|
72
|
+
export declare const onClickLeftFunctionButtonAtom: import('jotai').PrimitiveAtom<Callback<[], void>> & {
|
|
73
|
+
init: Callback<[], void>;
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* 当点击位于控制按钮右侧的按钮时触发的回调函数
|
|
77
|
+
*/
|
|
78
|
+
export declare const onClickRightFunctionButtonAtom: import('jotai').PrimitiveAtom<Callback<[], void>> & {
|
|
79
|
+
init: Callback<[], void>;
|
|
80
|
+
};
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { BackgroundRenderProps } from '@applemusic-like-lyrics/react';
|
|
2
|
+
/**
|
|
3
|
+
* 是否启用歌词行模糊效果,默认启用
|
|
4
|
+
*
|
|
5
|
+
* 性能影响情况:高
|
|
6
|
+
*/
|
|
7
|
+
export declare const enableLyricLineBlurEffectAtom: import('jotai').WritableAtom<boolean, [boolean | typeof import('jotai/utils').RESET | ((prev: boolean) => boolean | typeof import('jotai/utils').RESET)], void>;
|
|
8
|
+
/**
|
|
9
|
+
* 是否启用歌词行缩放效果,默认启用
|
|
10
|
+
*
|
|
11
|
+
* 性能影响情况:无
|
|
12
|
+
*/
|
|
13
|
+
export declare const enableLyricLineScaleEffectAtom: import('jotai').WritableAtom<boolean, [boolean | typeof import('jotai/utils').RESET | ((prev: boolean) => boolean | typeof import('jotai/utils').RESET)], void>;
|
|
14
|
+
/**
|
|
15
|
+
* 是否启用歌词行弹簧动画效果,默认启用
|
|
16
|
+
*
|
|
17
|
+
* 如果禁用,则会回退到基础的 CSS 属性动画效果
|
|
18
|
+
*
|
|
19
|
+
* 性能影响情况:中
|
|
20
|
+
*/
|
|
21
|
+
export declare const enableLyricLineSpringAnimationAtom: import('jotai').WritableAtom<boolean, [boolean | typeof import('jotai/utils').RESET | ((prev: boolean) => boolean | typeof import('jotai/utils').RESET)], void>;
|
|
22
|
+
/**
|
|
23
|
+
* 是否显示翻译歌词行,默认启用
|
|
24
|
+
*
|
|
25
|
+
* 性能影响情况:低
|
|
26
|
+
*/
|
|
27
|
+
export declare const enableLyricTranslationLineAtom: import('jotai').WritableAtom<boolean, [boolean | typeof import('jotai/utils').RESET | ((prev: boolean) => boolean | typeof import('jotai/utils').RESET)], void>;
|
|
28
|
+
/**
|
|
29
|
+
* 是否显示音译歌词行,默认启用
|
|
30
|
+
*
|
|
31
|
+
* 性能影响情况:低
|
|
32
|
+
*/
|
|
33
|
+
export declare const enableLyricRomanLineAtom: import('jotai').WritableAtom<boolean, [boolean | typeof import('jotai/utils').RESET | ((prev: boolean) => boolean | typeof import('jotai/utils').RESET)], void>;
|
|
34
|
+
/**
|
|
35
|
+
* 是否交换音译歌词行和翻译歌词行,默认禁用
|
|
36
|
+
*
|
|
37
|
+
* 性能影响情况:无
|
|
38
|
+
*/
|
|
39
|
+
export declare const enableLyricSwapTransRomanLineAtom: import('jotai').WritableAtom<boolean, [boolean | typeof import('jotai/utils').RESET | ((prev: boolean) => boolean | typeof import('jotai/utils').RESET)], void>;
|
|
40
|
+
/**
|
|
41
|
+
* 调节逐词歌词时单词的渐变过渡宽度,单位为一个全角字的宽度,默认为 0.5
|
|
42
|
+
*
|
|
43
|
+
* 如果要模拟 Apple Music for Android 的效果,可以设置为 1
|
|
44
|
+
*
|
|
45
|
+
* 如果要模拟 Apple Music for iPad 的效果,可以设置为 0.5
|
|
46
|
+
*
|
|
47
|
+
* 如需关闭逐词歌词时单词的渐变过渡效果,可以设置为 0
|
|
48
|
+
*
|
|
49
|
+
* 性能影响情况:无
|
|
50
|
+
*/
|
|
51
|
+
export declare const lyricWordFadeWidthAtom: import('jotai').WritableAtom<number, [number | typeof import('jotai/utils').RESET | ((prev: number) => number | typeof import('jotai/utils').RESET)], void>;
|
|
52
|
+
/**
|
|
53
|
+
* 设置仅歌词组件的字体家族(CSS Font Family 属性),默认为空(即继承自父元素)
|
|
54
|
+
*/
|
|
55
|
+
export declare const lyricFontFamilyAtom: import('jotai').WritableAtom<string, [string | typeof import('jotai/utils').RESET | ((prev: string) => string | typeof import('jotai/utils').RESET)], void>;
|
|
56
|
+
/**
|
|
57
|
+
* 设置仅歌词组件的字体字重(CSS Font Weight 属性),默认为 0 (即继承自父元素)
|
|
58
|
+
*/
|
|
59
|
+
export declare const lyricFontWeightAtom: import('jotai').WritableAtom<number, [number | typeof import('jotai/utils').RESET | ((prev: number) => number | typeof import('jotai/utils').RESET)], void>;
|
|
60
|
+
/**
|
|
61
|
+
* 设置仅歌词组件的字符间距(CSS Font Weight 属性),默认为 0 (即继承自父元素)
|
|
62
|
+
*/
|
|
63
|
+
export declare const lyricLetterSpacingAtom: import('jotai').WritableAtom<string, [string | typeof import('jotai/utils').RESET | ((prev: string) => string | typeof import('jotai/utils').RESET)], void>;
|
|
64
|
+
export declare enum PlayerControlsType {
|
|
65
|
+
Controls = "controls",
|
|
66
|
+
FFT = "fft",
|
|
67
|
+
None = "none"
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* 播放器控制器类型,默认为 `PlayerControlsType.Controls`
|
|
71
|
+
*/
|
|
72
|
+
export declare const playerControlsTypeAtom: import('jotai').WritableAtom<PlayerControlsType, [typeof import('jotai/utils').RESET | PlayerControlsType | ((prev: PlayerControlsType) => typeof import('jotai/utils').RESET | PlayerControlsType)], void>;
|
|
73
|
+
/**
|
|
74
|
+
* 是否显示歌曲名称,默认启用
|
|
75
|
+
*/
|
|
76
|
+
export declare const showMusicNameAtom: import('jotai').WritableAtom<boolean, [boolean | typeof import('jotai/utils').RESET | ((prev: boolean) => boolean | typeof import('jotai/utils').RESET)], void>;
|
|
77
|
+
/**
|
|
78
|
+
* 是否显示歌曲作者,默认启用
|
|
79
|
+
*/
|
|
80
|
+
export declare const showMusicArtistsAtom: import('jotai').WritableAtom<boolean, [boolean | typeof import('jotai/utils').RESET | ((prev: boolean) => boolean | typeof import('jotai/utils').RESET)], void>;
|
|
81
|
+
/**
|
|
82
|
+
* 是否显示歌曲专辑名称,默认启用
|
|
83
|
+
*/
|
|
84
|
+
export declare const showMusicAlbumAtom: import('jotai').WritableAtom<boolean, [boolean | typeof import('jotai/utils').RESET | ((prev: boolean) => boolean | typeof import('jotai/utils').RESET)], void>;
|
|
85
|
+
/**
|
|
86
|
+
* 是否显示音量滑块条,默认启用
|
|
87
|
+
*/
|
|
88
|
+
export declare const showVolumeControlAtom: import('jotai').WritableAtom<boolean, [boolean | typeof import('jotai/utils').RESET | ((prev: boolean) => boolean | typeof import('jotai/utils').RESET)], void>;
|
|
89
|
+
/**
|
|
90
|
+
* 是否显示底部控制按钮组,默认启用
|
|
91
|
+
*/
|
|
92
|
+
export declare const showBottomControlAtom: import('jotai').WritableAtom<boolean, [boolean | typeof import('jotai/utils').RESET | ((prev: boolean) => boolean | typeof import('jotai/utils').RESET)], void>;
|
|
93
|
+
/**
|
|
94
|
+
* 调节全局歌词时间戳位移,单位为毫秒,正值为提前,负值为推迟,默认为 0
|
|
95
|
+
*
|
|
96
|
+
* 性能影响情况:无
|
|
97
|
+
*/
|
|
98
|
+
export declare const globalLyricTimelineOffsetAtom: import('jotai').WritableAtom<number, [number | typeof import('jotai/utils').RESET | ((prev: number) => number | typeof import('jotai/utils').RESET)], void>;
|
|
99
|
+
/**
|
|
100
|
+
* 配置所使用的歌词背景渲染器,默认使用 MeshGradientRenderer
|
|
101
|
+
*
|
|
102
|
+
* 由于存储状态特殊,故不使用 atomWithStorage,请另外处理配置存储
|
|
103
|
+
*
|
|
104
|
+
* 性能影响情况:高
|
|
105
|
+
*/
|
|
106
|
+
export declare const lyricBackgroundRendererAtom: import('jotai').PrimitiveAtom<{
|
|
107
|
+
renderer: BackgroundRenderProps["renderer"];
|
|
108
|
+
}> & {
|
|
109
|
+
init: {
|
|
110
|
+
renderer: BackgroundRenderProps["renderer"];
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
/**
|
|
114
|
+
* 调节背景的最大帧率,默认 60
|
|
115
|
+
*
|
|
116
|
+
* 性能影响情况:高
|
|
117
|
+
*/
|
|
118
|
+
export declare const lyricBackgroundFPSAtom: import('jotai').WritableAtom<number, [number | typeof import('jotai/utils').RESET | ((prev: number) => number | typeof import('jotai/utils').RESET)], void>;
|
|
119
|
+
/**
|
|
120
|
+
* 调节背景的渲染倍率,默认为 1
|
|
121
|
+
*
|
|
122
|
+
* 性能影响情况:高
|
|
123
|
+
*/
|
|
124
|
+
export declare const lyricBackgroundRenderScaleAtom: import('jotai').WritableAtom<number, [number | typeof import('jotai/utils').RESET | ((prev: number) => number | typeof import('jotai/utils').RESET)], void>;
|
|
125
|
+
/**
|
|
126
|
+
* 是否启用背景静态模式,即除了切换背景以外的情况都将停止渲染以优化性能,默认禁用
|
|
127
|
+
*
|
|
128
|
+
* 性能影响情况:中
|
|
129
|
+
*/
|
|
130
|
+
export declare const lyricBackgroundStaticModeAtom: import('jotai').WritableAtom<NonNullable<boolean | undefined>, [typeof import('jotai/utils').RESET | NonNullable<boolean | undefined> | ((prev: NonNullable<boolean | undefined>) => typeof import('jotai/utils').RESET | NonNullable<boolean | undefined>)], void>;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { LyricLine } from '@applemusic-like-lyrics/core';
|
|
2
|
+
export interface ArtistStateEntry {
|
|
3
|
+
name: string;
|
|
4
|
+
id: string;
|
|
5
|
+
}
|
|
6
|
+
export declare enum AudioQualityType {
|
|
7
|
+
None = "none",
|
|
8
|
+
Lossless = "lossless",
|
|
9
|
+
HiRes = "hires",
|
|
10
|
+
DolbyAtmos = "dolby-atmos"
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* 当前播放的音乐名称,将会显示在专辑图下方(横向布局)或专辑图右侧(竖向布局)
|
|
14
|
+
*/
|
|
15
|
+
export declare const musicNameAtom: import('jotai').PrimitiveAtom<string> & {
|
|
16
|
+
init: string;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* 当前播放的音乐创作者列表,会显示在音乐名称下方
|
|
20
|
+
*/
|
|
21
|
+
export declare const musicArtistsAtom: import('jotai').PrimitiveAtom<ArtistStateEntry[]> & {
|
|
22
|
+
init: ArtistStateEntry[];
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* 当前播放的音乐所属专辑名称,会显示在音乐名称/创作者下方
|
|
26
|
+
*/
|
|
27
|
+
export declare const musicAlbumNameAtom: import('jotai').PrimitiveAtom<string> & {
|
|
28
|
+
init: string;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* 当前播放的音乐专辑封面 URL,除了图片也可以是视频资源
|
|
32
|
+
*/
|
|
33
|
+
export declare const musicCoverAtom: import('jotai').PrimitiveAtom<string> & {
|
|
34
|
+
init: string;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* 当前播放的音乐专辑封面资源是否为视频
|
|
38
|
+
*/
|
|
39
|
+
export declare const musicCoverIsVideoAtom: import('jotai').PrimitiveAtom<boolean> & {
|
|
40
|
+
init: boolean;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* 当前音乐的音乐时长,单位为毫秒
|
|
44
|
+
*/
|
|
45
|
+
export declare const musicDurationAtom: import('jotai').PrimitiveAtom<number> & {
|
|
46
|
+
init: number;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* 当前是否正在播放音乐
|
|
50
|
+
*/
|
|
51
|
+
export declare const musicPlayingAtom: import('jotai').PrimitiveAtom<boolean> & {
|
|
52
|
+
init: boolean;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* 当前音乐的音质水平,如有提供则会显示在进度条下
|
|
56
|
+
*/
|
|
57
|
+
export declare const musicQualityAtom: import('jotai').PrimitiveAtom<AudioQualityType> & {
|
|
58
|
+
init: AudioQualityType;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* 当前音乐的播放进度,单位为毫秒
|
|
62
|
+
*/
|
|
63
|
+
export declare const musicPlayingPositionAtom: import('jotai').PrimitiveAtom<number> & {
|
|
64
|
+
init: number;
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* 当前播放的音乐音量大小,范围在 [0.0-1.0] 之间
|
|
68
|
+
*
|
|
69
|
+
* 本状态将会保存在 localStorage 中
|
|
70
|
+
*/
|
|
71
|
+
export declare const musicVolumeAtom: import('jotai').WritableAtom<number, [number | typeof import('jotai/utils').RESET | ((prev: number) => number | typeof import('jotai/utils').RESET)], void>;
|
|
72
|
+
/**
|
|
73
|
+
* 当前播放的音乐专辑封面 URL,除了图片也可以是视频资源
|
|
74
|
+
*/
|
|
75
|
+
export declare const musicLyricLinesAtom: import('jotai').PrimitiveAtom<LyricLine[]> & {
|
|
76
|
+
init: LyricLine[];
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* 是否隐藏歌词视图
|
|
80
|
+
*/
|
|
81
|
+
export declare const hideLyricViewAtom: import('jotai').WritableAtom<boolean, [boolean | typeof import('jotai/utils').RESET | ((prev: boolean) => boolean | typeof import('jotai/utils').RESET)], void>;
|
|
82
|
+
/**
|
|
83
|
+
* 用于音频可视化频谱图的数据
|
|
84
|
+
* 如需呈现背景跳动效果,请设置 lowFreqVolumeAtom 的值
|
|
85
|
+
*/
|
|
86
|
+
export declare const fftDataAtom: import('jotai').PrimitiveAtom<number[]> & {
|
|
87
|
+
init: number[];
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* 低频音量大小,范围在 80hz-120hz 之间为宜,取值范围在 [0.0-1.0] 之间
|
|
91
|
+
*
|
|
92
|
+
* 如果无法获取到类似的数据,请传入 undefined 或 1.0 作为默认值,或不做任何处理(默认值即 1.0)
|
|
93
|
+
*
|
|
94
|
+
* 如需呈现音频可视化频谱图,请设置 fftDataAtom 的值
|
|
95
|
+
*/
|
|
96
|
+
export declare const lowFreqVolumeAtom: import('jotai').PrimitiveAtom<number> & {
|
|
97
|
+
init: number;
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* 当前是否正在展示 AMLL 播放页面,设置为 true 时将会让背景和歌词实时展示动画效果
|
|
101
|
+
* 推荐在页面被隐藏的时候将其设置为 false,这样会减少其对性能的影响(例如暂停背景渲染和歌词行变换等)
|
|
102
|
+
*/
|
|
103
|
+
export declare const isLyricPageOpenedAtom: import('jotai').PrimitiveAtom<boolean> & {
|
|
104
|
+
init: boolean;
|
|
105
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function toDuration(duration: number): string;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** MIT License github.com/pushkine/ */
|
|
2
|
+
export interface SpringParams {
|
|
3
|
+
mass: number;
|
|
4
|
+
damping: number;
|
|
5
|
+
stiffness: number;
|
|
6
|
+
soft: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare class Spring {
|
|
9
|
+
private currentPosition;
|
|
10
|
+
private targetPosition;
|
|
11
|
+
private currentTime;
|
|
12
|
+
private params;
|
|
13
|
+
private currentSolver;
|
|
14
|
+
private getV;
|
|
15
|
+
private queueParams;
|
|
16
|
+
private queuePosition;
|
|
17
|
+
constructor(currentPosition?: number);
|
|
18
|
+
private resetSolver;
|
|
19
|
+
arrived(): boolean;
|
|
20
|
+
setPosition(targetPosition: number): void;
|
|
21
|
+
update(delta?: number): void;
|
|
22
|
+
updateParams(params: Partial<SpringParams>, delay?: number): void;
|
|
23
|
+
setTargetPosition(targetPosition: number, delay?: number): void;
|
|
24
|
+
getCurrentPosition(): number;
|
|
25
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@applemusic-like-lyrics/react-full",
|
|
3
|
+
"version": "0.2.0-alpha.0",
|
|
4
|
+
"description": "AMLL 组件库的 React 绑定,但是更加完备且高度灵活",
|
|
5
|
+
"repository": {
|
|
6
|
+
"url": "https://github.com/Steve-xmh/applemusic-like-lyrics.git",
|
|
7
|
+
"directory": "packages/react-full",
|
|
8
|
+
"type": "git"
|
|
9
|
+
},
|
|
10
|
+
"type": "module",
|
|
11
|
+
"license": "GPL-3.0",
|
|
12
|
+
"main": "dist/amll-react-framework.cjs",
|
|
13
|
+
"module": "./dist/amll-react-framework.js",
|
|
14
|
+
"typings": "./dist/index.d.ts",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"import": "./dist/amll-react-framework.js",
|
|
18
|
+
"require": "./dist/amll-react-framework.cjs",
|
|
19
|
+
"types": "./dist/index.d.ts"
|
|
20
|
+
},
|
|
21
|
+
"./style.css": {
|
|
22
|
+
"import": "./dist/style.css",
|
|
23
|
+
"require": "./dist/style.css"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"dist/**/*.js",
|
|
28
|
+
"dist/**/*.ts",
|
|
29
|
+
"dist/**/*.cjs",
|
|
30
|
+
"dist/**/*.map"
|
|
31
|
+
],
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@biomejs/biome": "^1.8.3",
|
|
34
|
+
"@pixi/app": "^7.2.4",
|
|
35
|
+
"@pixi/core": "^7.2.4",
|
|
36
|
+
"@pixi/display": "^7.2.4",
|
|
37
|
+
"@pixi/filter-blur": "^7.2.4",
|
|
38
|
+
"@pixi/filter-color-matrix": "^7.2.4",
|
|
39
|
+
"@pixi/sprite": "^7.2.4",
|
|
40
|
+
"@radix-ui/themes": "^3.1.3",
|
|
41
|
+
"@types/react": "^18.3.5",
|
|
42
|
+
"@types/react-dom": "^18.2.7",
|
|
43
|
+
"@types/ungap__structured-clone": "^1.2.0",
|
|
44
|
+
"@vitejs/plugin-react": "^4.3.1",
|
|
45
|
+
"jotai": "^2.9.3",
|
|
46
|
+
"react": "^18.2.0",
|
|
47
|
+
"react-dom": "^18.2.0",
|
|
48
|
+
"typedoc": "^0.26.5",
|
|
49
|
+
"typedoc-plugin-markdown": "^4.2.3",
|
|
50
|
+
"typescript": "^5.5.4",
|
|
51
|
+
"vite": "^5.4.0",
|
|
52
|
+
"vite-plugin-dts": "^4.0.3",
|
|
53
|
+
"vite-plugin-svgr": "^4.2.0",
|
|
54
|
+
"vite-plugin-wasm": "^3.3.0",
|
|
55
|
+
"@applemusic-like-lyrics/lyric": "^0.2.4"
|
|
56
|
+
},
|
|
57
|
+
"dependencies": {
|
|
58
|
+
"@ungap/structured-clone": "^1.2.0",
|
|
59
|
+
"classnames": "^2.5.1",
|
|
60
|
+
"corner-smoothing": "^0.1.5",
|
|
61
|
+
"framer-motion": "^11.3.27",
|
|
62
|
+
"@applemusic-like-lyrics/core": "^0.2.0-alpha.0",
|
|
63
|
+
"@applemusic-like-lyrics/react": "^0.2.0-alpha.0"
|
|
64
|
+
},
|
|
65
|
+
"peerDependencies": {
|
|
66
|
+
"jotai": "*",
|
|
67
|
+
"react": "*",
|
|
68
|
+
"react-dom": "*"
|
|
69
|
+
},
|
|
70
|
+
"scripts": {
|
|
71
|
+
"build:docs": "typedoc --plugin typedoc-plugin-markdown --out docs src/index.ts",
|
|
72
|
+
"build": "vite build",
|
|
73
|
+
"build:dev": "vite build",
|
|
74
|
+
"fmt": "biome format --write ./src",
|
|
75
|
+
"dev": "vite dev",
|
|
76
|
+
"preinstall": "npx only-allow pnpm"
|
|
77
|
+
}
|
|
78
|
+
}
|