@ngxsplayer/ngx-smart-player-ui-audio 0.2.1 → 0.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ngxsplayer/ngx-smart-player-ui-audio",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "description": "Optional audio-focused UI components for ngx-smart-player.",
5
5
  "keywords": [
6
6
  "angular",
@@ -15,8 +15,8 @@
15
15
  "@angular/common": ">=17.1.0 <23.0.0",
16
16
  "@angular/core": ">=17.1.0 <23.0.0",
17
17
  "rxjs": ">=7.0.0 <8.0.0",
18
- "@ngxsplayer/ngx-smart-player": "^0.2.1",
19
- "@ngxsplayer/ngx-smart-player-ui-core": "^0.2.1"
18
+ "@ngxsplayer/ngx-smart-player": "^0.3.0",
19
+ "@ngxsplayer/ngx-smart-player-ui-core": "^0.3.0"
20
20
  },
21
21
  "sideEffects": false,
22
22
  "module": "fesm2022/ngxsplayer-ngx-smart-player-ui-audio.mjs",
@@ -15,8 +15,6 @@ export interface AudioUiListItem {
15
15
  duration?: string;
16
16
  artworkUrl?: string;
17
17
  favorite?: boolean;
18
- /** Whether this track is kept behind the lock. Only ever true while the vault is open to show it. */
19
- locked?: boolean;
20
18
  lastPlayedLabel?: string;
21
19
  progressPercent?: number;
22
20
  active?: boolean;
@@ -154,6 +152,13 @@ export declare class NgxSmartPlayerAudioUiComponent implements AfterViewChecked
154
152
  searchLabel: string;
155
153
  searchTerm: string;
156
154
  libraryViews: AudioUiBrowseChip[];
155
+ /**
156
+ * The few views that also get a shortcut in the title bar, named by their own ids. Empty by
157
+ * default: a player embedding this component decides what is worth a shortcut, and an id it
158
+ * does not list in `libraryViews` is simply ignored rather than drawn as a dead button.
159
+ */
160
+ quickViewIds: string[];
161
+ quickViewsLabel: string;
157
162
  activeLibraryView: string;
158
163
  librarySections: AudioUiBrowseSection[];
159
164
  queueTitle: string;
@@ -222,13 +227,9 @@ export declare class NgxSmartPlayerAudioUiComponent implements AfterViewChecked
222
227
  currentArtworkUrl: string;
223
228
  favoriteActive: boolean;
224
229
  favoriteLabel: string;
225
- /** Whether anything can be locked: there has to be a code to unlock with first. */
226
- lockAvailable: boolean;
227
230
  /** Whether a piece of a track can be made into a ringtone here. */
228
231
  ringtoneAvailable: boolean;
229
232
  ringtoneLabel: string;
230
- lockLabel: string;
231
- unlockLabel: string;
232
233
  favoriteActiveLabel: string;
233
234
  favoritesLabel: string;
234
235
  queueItems: AudioUiListItem[];
@@ -250,6 +251,9 @@ export declare class NgxSmartPlayerAudioUiComponent implements AfterViewChecked
250
251
  stationForm: AudioUiStationForm | null;
251
252
  /** The Settings view's sections, shown in place of the library while the host passes them. */
252
253
  settingsSections: SmartSettingsSection[];
254
+ /** The way out of the settings page, naming the view it returns to. */
255
+ settingsBackLabel: string | null;
256
+ settingsBack: EventEmitter<void>;
253
257
  /** Shown above the library sections, to connect a media server. */
254
258
  serverForm: AudioUiServerForm | null;
255
259
  devicesOpen: boolean;
@@ -342,7 +346,6 @@ export declare class NgxSmartPlayerAudioUiComponent implements AfterViewChecked
342
346
  primaryPlaybackToggle: EventEmitter<AudioUiPlaybackIntent>;
343
347
  playerStateChange: EventEmitter<PlayerState>;
344
348
  toggleFavorite: EventEmitter<string>;
345
- toggleLock: EventEmitter<string>;
346
349
  makeRingtone: EventEmitter<string>;
347
350
  /** "Show in Finder" for the track playing, where the host can show its file (desktop); empty hides the button. */
348
351
  revealFileLabel: string;
@@ -365,6 +368,29 @@ export declare class NgxSmartPlayerAudioUiComponent implements AfterViewChecked
365
368
  private sheetButtonEl?;
366
369
  private lyricsFollowed;
367
370
  private queueFollowed;
371
+ /**
372
+ * The queue holds the whole library, and every row of it used to be built: four thousand
373
+ * tracks measured at four thousand rows and thirty-seven thousand nodes, rebuilt from scratch
374
+ * each time the lock hid or showed one — which is the refresh that looked like a freeze on a
375
+ * phone. Only what the list can show is built now. Two blank elements hold the space above and
376
+ * below, so the scrollbar still tells the truth about how long the queue is.
377
+ *
378
+ * A row is 56px tall with a 1px gap. A list shorter than one window is left whole, because the
379
+ * window costs more than it saves there.
380
+ */
381
+ private static readonly QUEUE_ROW;
382
+ private static readonly QUEUE_WINDOW_MIN;
383
+ private static readonly QUEUE_OVERSCAN;
384
+ private queueFrom;
385
+ private queueTo;
386
+ private get queueWindowed();
387
+ protected get windowedQueue(): AudioUiListItem[];
388
+ protected get queueSpaceBefore(): number;
389
+ protected get queueSpaceAfter(): number;
390
+ /** Follows the scroll: the rows under the eye, and a few on either side so none flashes in. */
391
+ protected onQueueScroll(): void;
392
+ /** Brings a row into the window, so that what is playing can be scrolled to even far down. */
393
+ private holdQueueRow;
368
394
  fileDragActive: boolean;
369
395
  /** Phones only: the queue, lists, devices and lyrics live in a sheet the listener opens. */
370
396
  panelSheetOpen: boolean;
@@ -398,6 +424,10 @@ export declare class NgxSmartPlayerAudioUiComponent implements AfterViewChecked
398
424
  get isPlaying(): boolean;
399
425
  get isHomeView(): boolean;
400
426
  get primaryViews(): AudioUiBrowseChip[];
427
+ /** Whether this view already has a shortcut, which is what lets the strip drop it. */
428
+ hasQuickView(id: string): boolean;
429
+ /** The shortcuts, in the order they were asked for rather than the order the rail lists them. */
430
+ get quickViews(): AudioUiBrowseChip[];
401
431
  get appViews(): AudioUiBrowseChip[];
402
432
  get collectionViews(): AudioUiBrowseChip[];
403
433
  /** The first open panel, for the few places that still speak of one at a time. */
@@ -620,6 +650,14 @@ export declare class NgxSmartPlayerAudioUiComponent implements AfterViewChecked
620
650
  "alias": "libraryViews";
621
651
  "required": false;
622
652
  };
653
+ "quickViewIds": {
654
+ "alias": "quickViewIds";
655
+ "required": false;
656
+ };
657
+ "quickViewsLabel": {
658
+ "alias": "quickViewsLabel";
659
+ "required": false;
660
+ };
623
661
  "activeLibraryView": {
624
662
  "alias": "activeLibraryView";
625
663
  "required": false;
@@ -868,10 +906,6 @@ export declare class NgxSmartPlayerAudioUiComponent implements AfterViewChecked
868
906
  "alias": "favoriteLabel";
869
907
  "required": false;
870
908
  };
871
- "lockAvailable": {
872
- "alias": "lockAvailable";
873
- "required": false;
874
- };
875
909
  "ringtoneAvailable": {
876
910
  "alias": "ringtoneAvailable";
877
911
  "required": false;
@@ -880,14 +914,6 @@ export declare class NgxSmartPlayerAudioUiComponent implements AfterViewChecked
880
914
  "alias": "ringtoneLabel";
881
915
  "required": false;
882
916
  };
883
- "lockLabel": {
884
- "alias": "lockLabel";
885
- "required": false;
886
- };
887
- "unlockLabel": {
888
- "alias": "unlockLabel";
889
- "required": false;
890
- };
891
917
  "favoriteActiveLabel": {
892
918
  "alias": "favoriteActiveLabel";
893
919
  "required": false;
@@ -924,6 +950,10 @@ export declare class NgxSmartPlayerAudioUiComponent implements AfterViewChecked
924
950
  "alias": "settingsSections";
925
951
  "required": false;
926
952
  };
953
+ "settingsBackLabel": {
954
+ "alias": "settingsBackLabel";
955
+ "required": false;
956
+ };
927
957
  "serverForm": {
928
958
  "alias": "serverForm";
929
959
  "required": false;
@@ -1027,6 +1057,7 @@ export declare class NgxSmartPlayerAudioUiComponent implements AfterViewChecked
1027
1057
  }, {
1028
1058
  "compactModeChange": "compactModeChange";
1029
1059
  "compactLyricsToggle": "compactLyricsToggle";
1060
+ "settingsBack": "settingsBack";
1030
1061
  "ended": "ended";
1031
1062
  "videoSize": "videoSize";
1032
1063
  "progress": "progress";
@@ -1068,7 +1099,6 @@ export declare class NgxSmartPlayerAudioUiComponent implements AfterViewChecked
1068
1099
  "primaryPlaybackToggle": "primaryPlaybackToggle";
1069
1100
  "playerStateChange": "playerStateChange";
1070
1101
  "toggleFavorite": "toggleFavorite";
1071
- "toggleLock": "toggleLock";
1072
1102
  "makeRingtone": "makeRingtone";
1073
1103
  "revealFile": "revealFile";
1074
1104
  "sourceFileChange": "sourceFileChange";
@@ -1083,4 +1113,5 @@ export declare class NgxSmartPlayerAudioUiModule {
1083
1113
  static ɵfac: i0.ɵɵFactoryDeclaration<NgxSmartPlayerAudioUiModule, never>;
1084
1114
  static ɵmod: i0.ɵɵNgModuleDeclaration<NgxSmartPlayerAudioUiModule, never, [typeof NgxSmartPlayerAudioUiComponent], [typeof NgxSmartPlayerAudioUiComponent]>;
1085
1115
  static ɵinj: i0.ɵɵInjectorDeclaration<NgxSmartPlayerAudioUiModule>;
1086
- }
1116
+ }
1117
+ export {};