@applemusic-like-lyrics/react-full 0.2.0-alpha.1 → 0.2.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.
Files changed (63) hide show
  1. package/README.md +4 -2
  2. package/dist/amll-react-framework.css +1023 -0
  3. package/dist/amll-react-framework.js +13730 -6817
  4. package/dist/amll-react-framework.js.map +1 -1
  5. package/dist/components/AudioFFTVisualizer/index.d.ts +1 -0
  6. package/dist/components/AudioFFTVisualizer/index.d.ts.map +1 -0
  7. package/dist/components/AudioQualityTag/index.d.ts +7 -5
  8. package/dist/components/AudioQualityTag/index.d.ts.map +1 -0
  9. package/dist/components/BouncingSlider/index.d.ts +13 -8
  10. package/dist/components/BouncingSlider/index.d.ts.map +1 -0
  11. package/dist/components/ControlThumb/index.d.ts +2 -1
  12. package/dist/components/ControlThumb/index.d.ts.map +1 -0
  13. package/dist/components/Cover/index.d.ts +2 -1
  14. package/dist/components/Cover/index.d.ts.map +1 -0
  15. package/dist/components/MediaButton/index.d.ts +3 -2
  16. package/dist/components/MediaButton/index.d.ts.map +1 -0
  17. package/dist/components/MenuButton/index.d.ts +1 -0
  18. package/dist/components/MenuButton/index.d.ts.map +1 -0
  19. package/dist/components/MusicInfo/index.d.ts +1 -0
  20. package/dist/components/MusicInfo/index.d.ts.map +1 -0
  21. package/dist/components/PrebuiltLyricPlayer/index.d.ts +5 -2
  22. package/dist/components/PrebuiltLyricPlayer/index.d.ts.map +1 -0
  23. package/dist/components/TextMarquee/index.d.ts +1 -0
  24. package/dist/components/TextMarquee/index.d.ts.map +1 -0
  25. package/dist/components/ToggleIconButton/index.d.ts +1 -0
  26. package/dist/components/ToggleIconButton/index.d.ts.map +1 -0
  27. package/dist/components/ToggleIconButton/prebuilt-enum.d.ts +1 -0
  28. package/dist/components/ToggleIconButton/prebuilt-enum.d.ts.map +1 -0
  29. package/dist/components/VolumeControlSlider/index.d.ts +4 -2
  30. package/dist/components/VolumeControlSlider/index.d.ts.map +1 -0
  31. package/dist/components/index.d.ts +1 -0
  32. package/dist/components/index.d.ts.map +1 -0
  33. package/dist/hook/useThrottle.d.ts +11 -0
  34. package/dist/hook/useThrottle.d.ts.map +1 -0
  35. package/dist/index.d.ts +5 -1
  36. package/dist/index.d.ts.map +1 -0
  37. package/dist/layout/auto.d.ts +4 -1
  38. package/dist/layout/auto.d.ts.map +1 -0
  39. package/dist/layout/horizontal.d.ts +2 -1
  40. package/dist/layout/horizontal.d.ts.map +1 -0
  41. package/dist/layout/index.d.ts +1 -0
  42. package/dist/layout/index.d.ts.map +1 -0
  43. package/dist/layout/vertical.d.ts +3 -1
  44. package/dist/layout/vertical.d.ts.map +1 -0
  45. package/dist/states/callbacks.d.ts +93 -0
  46. package/dist/states/callbacks.d.ts.map +1 -0
  47. package/dist/states/configAtoms.d.ts +174 -0
  48. package/dist/states/configAtoms.d.ts.map +1 -0
  49. package/dist/states/controlsAtoms.d.ts +24 -0
  50. package/dist/states/controlsAtoms.d.ts.map +1 -0
  51. package/dist/states/{music.d.ts → dataAtoms.d.ts} +71 -32
  52. package/dist/states/dataAtoms.d.ts.map +1 -0
  53. package/dist/utils/duration.d.ts +1 -0
  54. package/dist/utils/duration.d.ts.map +1 -0
  55. package/dist/utils/index.d.ts +1 -1
  56. package/dist/utils/index.d.ts.map +1 -0
  57. package/package.json +43 -37
  58. package/dist/amll-react-framework.cjs +0 -64
  59. package/dist/amll-react-framework.cjs.map +0 -1
  60. package/dist/states/callback.d.ts +0 -80
  61. package/dist/states/config.d.ts +0 -130
  62. package/dist/states/index.d.ts +0 -3
  63. package/dist/utils/spring.d.ts +0 -25
@@ -1,80 +0,0 @@
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
- };
@@ -1,130 +0,0 @@
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>;
@@ -1,3 +0,0 @@
1
- export * from './callback';
2
- export * from './config';
3
- export * from './music';
@@ -1,25 +0,0 @@
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
- }