smooth-player 1.0.4 → 2.1.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/README.md +116 -12
- package/assets/icons/logo-wave-preview.svg +28 -0
- package/assets/icons/logo.svg +8 -0
- package/assets/icons/stop.svg +3 -0
- package/assets/icons/upload.svg +5 -0
- package/assets/icons/visualizer.svg +7 -0
- package/dist/SmoothPlayer.d.ts +16 -1
- package/dist/SmoothPlayer.js +296 -13
- package/dist/i18n/en.generated.d.ts +50 -0
- package/dist/i18n/en.generated.js +51 -0
- package/dist/i18n/strings.d.ts +51 -0
- package/dist/i18n/strings.js +2 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.js +2 -1
- package/dist/smooth-player.css +582 -154
- package/dist/types.d.ts +31 -0
- package/dist/ui.d.ts +1 -1
- package/dist/ui.js +567 -14
- package/dist/visualizers.d.ts +2 -0
- package/dist/visualizers.js +150 -15
- package/dist-cjs/SmoothPlayer.js +296 -13
- package/dist-cjs/i18n/en.generated.js +54 -0
- package/dist-cjs/i18n/strings.js +5 -0
- package/dist-cjs/index.js +4 -2
- package/dist-cjs/ui.js +568 -15
- package/dist-cjs/visualizers.js +150 -15
- package/package.json +4 -3
- package/styles/common/_base.scss +223 -95
- package/styles/themes/_nocturne.scss +408 -62
- package/styles/themes/_aurora.scss +0 -70
- package/styles/themes/_ocean.scss +0 -13
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
export type VisualizerMode = "spectrum" | "waveform" | "none";
|
|
2
|
+
export interface SpectrumStyleOptions {
|
|
3
|
+
dualLayer: boolean;
|
|
4
|
+
inverted: boolean;
|
|
5
|
+
barWidth: "thin" | "medium" | "large";
|
|
6
|
+
}
|
|
7
|
+
export interface WaveformStyleOptions {
|
|
8
|
+
doubleLine: boolean;
|
|
9
|
+
fill: boolean;
|
|
10
|
+
thickLine: boolean;
|
|
11
|
+
}
|
|
2
12
|
export interface TrackMetadata {
|
|
3
13
|
title?: string;
|
|
4
14
|
artist?: string;
|
|
@@ -92,6 +102,15 @@ export interface PlaylistPanelController {
|
|
|
92
102
|
getOpen: () => boolean;
|
|
93
103
|
setOpen: (open: boolean) => void;
|
|
94
104
|
}
|
|
105
|
+
export interface AudioDropMountOptions {
|
|
106
|
+
activeClassName?: string;
|
|
107
|
+
onDrop?: (payload: {
|
|
108
|
+
file: File;
|
|
109
|
+
track: AudioTrack;
|
|
110
|
+
tracks: AudioTrack[];
|
|
111
|
+
kind: "audio" | "playlist";
|
|
112
|
+
}) => void;
|
|
113
|
+
}
|
|
95
114
|
export interface DebugPanelMountOptions {
|
|
96
115
|
enabled?: boolean;
|
|
97
116
|
panel: HTMLElement;
|
|
@@ -106,6 +125,12 @@ export interface DebugPanelMountOptions {
|
|
|
106
125
|
}
|
|
107
126
|
export interface StandardPlayerUIMountOptions {
|
|
108
127
|
debugEnabled?: boolean;
|
|
128
|
+
enableAudioDrop?: boolean;
|
|
129
|
+
enableErrorNotice?: boolean;
|
|
130
|
+
showLogo?: boolean;
|
|
131
|
+
persistUserPreferences?: boolean;
|
|
132
|
+
userPreferencesCookieName?: string;
|
|
133
|
+
userPreferencesMaxAgeDays?: number;
|
|
109
134
|
}
|
|
110
135
|
export interface StandardPlayerUIController {
|
|
111
136
|
destroy: () => void;
|
|
@@ -121,8 +146,11 @@ export interface SmoothPlayerOptions {
|
|
|
121
146
|
initialVolume?: number;
|
|
122
147
|
initialTrackIndex?: number;
|
|
123
148
|
accentColor?: string;
|
|
149
|
+
backgroundColor?: string;
|
|
124
150
|
analyzer?: AnalyzerOptions;
|
|
125
151
|
visualizer?: VisualizerMode;
|
|
152
|
+
spectrumStyle?: Partial<SpectrumStyleOptions>;
|
|
153
|
+
waveformStyle?: Partial<WaveformStyleOptions>;
|
|
126
154
|
initialShuffle?: boolean;
|
|
127
155
|
durationFallback?: boolean;
|
|
128
156
|
}
|
|
@@ -137,7 +165,10 @@ export interface PlaybackState {
|
|
|
137
165
|
playlistTitle: string;
|
|
138
166
|
playlistCount: number;
|
|
139
167
|
visualizer: VisualizerMode;
|
|
168
|
+
spectrumStyle: SpectrumStyleOptions;
|
|
169
|
+
waveformStyle: WaveformStyleOptions;
|
|
140
170
|
accentColor: string;
|
|
171
|
+
backgroundColor: string;
|
|
141
172
|
shuffle: boolean;
|
|
142
173
|
}
|
|
143
174
|
export interface PlayerEvents {
|
package/dist/ui.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { SmoothPlayer } from "./SmoothPlayer.js";
|
|
2
2
|
import { type StandardPlayerUIController, type StandardPlayerUIMountOptions } from "./types.js";
|
|
3
|
-
export declare function
|
|
3
|
+
export declare function mountPlayerUI(player: SmoothPlayer, root: HTMLElement, options?: StandardPlayerUIMountOptions): StandardPlayerUIController;
|