@behindthemusictree/app-kit 40.1.0 → 42.0.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/dist/{app-error-B8IoFBhD.d.ts → app-error-ZuIP62i5.d.ts} +3 -1
- package/dist/auth/index.cjs.map +1 -1
- package/dist/auth/index.d.ts +1 -1
- package/dist/auth/index.js +3 -3
- package/dist/{chunk-G5ULARLT.js → chunk-26YBFC2L.js} +11 -1
- package/dist/chunk-26YBFC2L.js.map +1 -0
- package/dist/{chunk-I7NXFXV3.js → chunk-2TJEWD56.js} +2 -2
- package/dist/{chunk-WL2TKQVN.js → chunk-3Y7RT7QF.js} +2 -2
- package/dist/{chunk-4MEK3CNF.js → chunk-MPTID5ZR.js} +3 -1
- package/dist/{chunk-4MEK3CNF.js.map → chunk-MPTID5ZR.js.map} +1 -1
- package/dist/{chunk-MF7SJIEY.js → chunk-PZHKZHQY.js} +3 -3
- package/dist/{chunk-D5UFJF4K.js → chunk-QNBZQZEL.js} +186 -170
- package/dist/chunk-QNBZQZEL.js.map +1 -0
- package/dist/chunk-RGHDVBEY.js +26 -0
- package/dist/chunk-RGHDVBEY.js.map +1 -0
- package/dist/{chunk-AYAKFCBP.js → chunk-WHJNRJRZ.js} +23 -15
- package/dist/chunk-WHJNRJRZ.js.map +1 -0
- package/dist/genre-tree/index.cjs +215 -164
- package/dist/genre-tree/index.cjs.map +1 -1
- package/dist/genre-tree/index.d.ts +77 -30
- package/dist/genre-tree/index.js +20 -6
- package/dist/genre-tree/testing.cjs +11 -0
- package/dist/genre-tree/testing.cjs.map +1 -1
- package/dist/genre-tree/testing.d.ts +1 -1
- package/dist/genre-tree/testing.js +1 -1
- package/dist/ids-FmUQ8DVM.d.ts +18 -0
- package/dist/index.cjs +221 -164
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +30 -10
- package/dist/popup/index.cjs.map +1 -1
- package/dist/popup/index.js +2 -2
- package/dist/transport/index.cjs +24 -2
- package/dist/transport/index.cjs.map +1 -1
- package/dist/transport/index.d.ts +3 -3
- package/dist/transport/index.js +11 -5
- package/dist/useFetchWrapper-H0lO4wFO.d.ts +41 -0
- package/package.json +1 -1
- package/dist/chunk-AYAKFCBP.js.map +0 -1
- package/dist/chunk-D5UFJF4K.js.map +0 -1
- package/dist/chunk-G5ULARLT.js.map +0 -1
- package/dist/chunk-JMFEWI53.js +0 -10
- package/dist/chunk-JMFEWI53.js.map +0 -1
- package/dist/ids-D8XCErUS.d.ts +0 -8
- package/dist/useFetchWrapper-C5lt5fQz.d.ts +0 -15
- /package/dist/{chunk-I7NXFXV3.js.map → chunk-2TJEWD56.js.map} +0 -0
- /package/dist/{chunk-WL2TKQVN.js.map → chunk-3Y7RT7QF.js.map} +0 -0
- /package/dist/{chunk-MF7SJIEY.js.map → chunk-PZHKZHQY.js.map} +0 -0
|
@@ -2,9 +2,9 @@ import * as _tanstack_react_query from '@tanstack/react-query';
|
|
|
2
2
|
import { QueryKey, InfiniteData } from '@tanstack/react-query';
|
|
3
3
|
import * as zod from 'zod';
|
|
4
4
|
import { z } from 'zod';
|
|
5
|
-
import { S as Scope, u as useFetchWrapper } from '../useFetchWrapper-
|
|
6
|
-
import {
|
|
7
|
-
export { a as GenrePlaylistUuidSchema,
|
|
5
|
+
import { R as ResourceResult, S as Scope, u as useFetchWrapper } from '../useFetchWrapper-H0lO4wFO.js';
|
|
6
|
+
import { c as GenreUuid, G as GenrePlaylistUuid } from '../ids-FmUQ8DVM.js';
|
|
7
|
+
export { A as ArtistUuid, a as ArtistUuidSchema, b as GenrePlaylistUuidSchema, d as GenreUuidSchema, S as SongUuid, e as SongUuidSchema, t as toArtistUuid, f as toGenreUuid, g as toSongUuid } from '../ids-FmUQ8DVM.js';
|
|
8
8
|
import * as react from 'react';
|
|
9
9
|
import { ReactNode } from 'react';
|
|
10
10
|
|
|
@@ -118,6 +118,13 @@ declare const CriteriaOverviewSchema: z.ZodObject<{
|
|
|
118
118
|
summary: z.ZodNullable<z.ZodString>;
|
|
119
119
|
description: z.ZodNullable<z.ZodString>;
|
|
120
120
|
summarySourceUrl: z.ZodNullable<z.ZodURL>;
|
|
121
|
+
image: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
122
|
+
url: z.ZodURL;
|
|
123
|
+
pageUrl: z.ZodURL;
|
|
124
|
+
author: z.ZodNullable<z.ZodString>;
|
|
125
|
+
license: z.ZodString;
|
|
126
|
+
licenseUrl: z.ZodNullable<z.ZodURL>;
|
|
127
|
+
}, z.core.$strip>>>;
|
|
121
128
|
essentialSongs: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
122
129
|
title: z.ZodString;
|
|
123
130
|
uuid: z.ZodString;
|
|
@@ -151,7 +158,14 @@ declare function useListGenres(page: number | undefined, pageSize: number | stri
|
|
|
151
158
|
totalPages: number;
|
|
152
159
|
}>, Error>;
|
|
153
160
|
declare function useFetchGenre(scope: Scope, getBackendBaseUrl: () => string): (id: GenreUuid) => Promise<CriteriaDetailed>;
|
|
154
|
-
|
|
161
|
+
type UseGenreResult<D extends CriteriaDetailed = CriteriaDetailed> = Exclude<ResourceResult<D>, {
|
|
162
|
+
status: "success";
|
|
163
|
+
}> | {
|
|
164
|
+
status: "success";
|
|
165
|
+
genre: D;
|
|
166
|
+
};
|
|
167
|
+
/** `id` may be a raw URL value: a malformed uuid is not found without a request. */
|
|
168
|
+
declare function useFetchGenreDetail<D extends CriteriaDetailed = CriteriaDetailed>(id: string | null, scope: Scope, getBackendBaseUrl: () => string, schema?: z.ZodType<D, unknown>): UseGenreResult<D>;
|
|
155
169
|
/** The genre carrying a Wikidata item id: `undefined` while loading or disabled, `null` when the API has none. */
|
|
156
170
|
declare function useGenreByWikidataId(qid: string | null, scope: Scope, getBackendBaseUrl: () => string): {
|
|
157
171
|
data: {
|
|
@@ -3340,6 +3354,16 @@ declare const useListFullGenrePlaylists: (scope: Scope, getBackendBaseUrl: () =>
|
|
|
3340
3354
|
declare const useFetchGenrePlaylist: <T>(uuid: GenrePlaylistUuid, getBackendBaseUrl: () => string, criteriaPlaylistDetailedSchema: z.ZodType<T, unknown>) => _tanstack_react_query.UseQueryResult<NoInfer<T>, Error>;
|
|
3341
3355
|
declare const useInvalidateAllGenrePlaylistQueries: () => () => Promise<[void, void, void, void]>;
|
|
3342
3356
|
|
|
3357
|
+
/** A Wikimedia Commons image with the attribution its license requires. */
|
|
3358
|
+
declare const CommonsImageSchema: z.ZodObject<{
|
|
3359
|
+
url: z.ZodURL;
|
|
3360
|
+
pageUrl: z.ZodURL;
|
|
3361
|
+
author: z.ZodNullable<z.ZodString>;
|
|
3362
|
+
license: z.ZodString;
|
|
3363
|
+
licenseUrl: z.ZodNullable<z.ZodURL>;
|
|
3364
|
+
}, z.core.$strip>;
|
|
3365
|
+
type CommonsImage = z.infer<typeof CommonsImageSchema>;
|
|
3366
|
+
|
|
3343
3367
|
declare const ARTIST_LINK_KINDS: readonly ["official", "wikipedia", "wikidata", "spotify", "youtube", "bandcamp", "soundcloud", "discogs", "social"];
|
|
3344
3368
|
declare const ArtistImageSchema: z.ZodObject<{
|
|
3345
3369
|
url: z.ZodURL;
|
|
@@ -3348,6 +3372,18 @@ declare const ArtistImageSchema: z.ZodObject<{
|
|
|
3348
3372
|
license: z.ZodString;
|
|
3349
3373
|
licenseUrl: z.ZodNullable<z.ZodURL>;
|
|
3350
3374
|
}, z.core.$strip>;
|
|
3375
|
+
declare const ArtistOriginSchema: z.ZodObject<{
|
|
3376
|
+
name: z.ZodString;
|
|
3377
|
+
kind: z.ZodString;
|
|
3378
|
+
source: z.ZodEnum<{
|
|
3379
|
+
area: "area";
|
|
3380
|
+
begin_area: "begin_area";
|
|
3381
|
+
}>;
|
|
3382
|
+
wikidataId: z.ZodNullable<z.ZodString>;
|
|
3383
|
+
longitude: z.ZodNullable<z.ZodNumber>;
|
|
3384
|
+
latitude: z.ZodNullable<z.ZodNumber>;
|
|
3385
|
+
regionId: z.ZodNullable<z.ZodString>;
|
|
3386
|
+
}, z.core.$strip>;
|
|
3351
3387
|
declare const ArtistDetailedSchema: z.ZodObject<{
|
|
3352
3388
|
uuid: z.ZodString;
|
|
3353
3389
|
name: z.ZodString;
|
|
@@ -3416,25 +3452,33 @@ declare const ArtistDetailedSchema: z.ZodObject<{
|
|
|
3416
3452
|
license: z.ZodString;
|
|
3417
3453
|
licenseUrl: z.ZodNullable<z.ZodURL>;
|
|
3418
3454
|
}, z.core.$strip>>;
|
|
3455
|
+
origin: z.ZodNullable<z.ZodObject<{
|
|
3456
|
+
name: z.ZodString;
|
|
3457
|
+
kind: z.ZodString;
|
|
3458
|
+
source: z.ZodEnum<{
|
|
3459
|
+
area: "area";
|
|
3460
|
+
begin_area: "begin_area";
|
|
3461
|
+
}>;
|
|
3462
|
+
wikidataId: z.ZodNullable<z.ZodString>;
|
|
3463
|
+
longitude: z.ZodNullable<z.ZodNumber>;
|
|
3464
|
+
latitude: z.ZodNullable<z.ZodNumber>;
|
|
3465
|
+
regionId: z.ZodNullable<z.ZodString>;
|
|
3466
|
+
}, z.core.$strip>>;
|
|
3419
3467
|
}, z.core.$strip>;
|
|
3420
|
-
type ArtistImage =
|
|
3468
|
+
type ArtistImage = CommonsImage;
|
|
3469
|
+
type ArtistOrigin = z.infer<typeof ArtistOriginSchema>;
|
|
3421
3470
|
type ArtistDetailed = z.infer<typeof ArtistDetailedSchema>;
|
|
3422
3471
|
type ArtistMembership = ArtistDetailed["members"][number];
|
|
3423
3472
|
type ArtistLink = ArtistDetailed["links"][number];
|
|
3424
3473
|
type ArtistAlbum = ArtistDetailed["albums"][number];
|
|
3425
3474
|
|
|
3426
|
-
type UseArtistResult = {
|
|
3427
|
-
status: "
|
|
3428
|
-
} | {
|
|
3429
|
-
status: "not-found";
|
|
3430
|
-
} | {
|
|
3431
|
-
status: "error";
|
|
3432
|
-
} | {
|
|
3433
|
-
status: "loading";
|
|
3434
|
-
} | {
|
|
3475
|
+
type UseArtistResult = Exclude<ResourceResult<ArtistDetailed>, {
|
|
3476
|
+
status: "success";
|
|
3477
|
+
}> | {
|
|
3435
3478
|
status: "success";
|
|
3436
3479
|
artist: ArtistDetailed;
|
|
3437
3480
|
};
|
|
3481
|
+
/** `null` = absent (idle); any string is validated, and a malformed one is not found without a request. */
|
|
3438
3482
|
declare function useArtist(uuid: string | null, getBackendBaseUrl: () => string): UseArtistResult;
|
|
3439
3483
|
|
|
3440
3484
|
declare const ArtistSearchResultSchema: z.ZodObject<{
|
|
@@ -3609,18 +3653,13 @@ declare function songUnplayableReason(song: SongDetailed): string | null;
|
|
|
3609
3653
|
/** MusicBrainz recording page URL, or null when the song has no MBID. */
|
|
3610
3654
|
declare function musicBrainzRecordingUrl(song: SongDetailed): string | null;
|
|
3611
3655
|
|
|
3612
|
-
type UseSongResult = {
|
|
3613
|
-
status: "
|
|
3614
|
-
} | {
|
|
3615
|
-
status: "not-found";
|
|
3616
|
-
} | {
|
|
3617
|
-
status: "error";
|
|
3618
|
-
} | {
|
|
3619
|
-
status: "loading";
|
|
3620
|
-
} | {
|
|
3656
|
+
type UseSongResult = Exclude<ResourceResult<SongDetailed>, {
|
|
3657
|
+
status: "success";
|
|
3658
|
+
}> | {
|
|
3621
3659
|
status: "success";
|
|
3622
3660
|
song: SongDetailed;
|
|
3623
3661
|
};
|
|
3662
|
+
/** `null` = absent (idle); any string is validated, and a malformed one is not found without a request. */
|
|
3624
3663
|
declare function useSong(uuid: string | null, getBackendBaseUrl: () => string): UseSongResult;
|
|
3625
3664
|
|
|
3626
3665
|
declare const SongHistoryEntrySchema: z.ZodObject<{
|
|
@@ -3651,7 +3690,7 @@ type UseSongHistoryResult = {
|
|
|
3651
3690
|
status: "success";
|
|
3652
3691
|
entries: SongHistoryEntry[];
|
|
3653
3692
|
};
|
|
3654
|
-
/** Lazy: nothing is fetched until `enabled`, e.g. while the panel's History section is open. */
|
|
3693
|
+
/** Lazy: nothing is fetched until `enabled`, e.g. while the panel's History section is open. A null or malformed `uuid` stays idle. */
|
|
3655
3694
|
declare function useSongHistory(uuid: string | null, getBackendBaseUrl: () => string, enabled: boolean): UseSongHistoryResult;
|
|
3656
3695
|
|
|
3657
3696
|
declare const SongSearchResultSchema: z.ZodObject<{
|
|
@@ -3721,7 +3760,7 @@ interface UseSongSearchResult {
|
|
|
3721
3760
|
}
|
|
3722
3761
|
declare function useSongSearch(getBackendBaseUrl: () => string, text: string, options?: Omit<SongSearchParams, "q">): UseSongSearchResult;
|
|
3723
3762
|
|
|
3724
|
-
/** The artist's footprint on the canonical tree (sparse: non-zero genre playlists only). Idle while `artistUuid` is null. */
|
|
3763
|
+
/** The artist's footprint on the canonical tree (sparse: non-zero genre playlists only). Idle while `artistUuid` is null or malformed, with no request. */
|
|
3725
3764
|
declare function useArtistGenreCounts(artistUuid: string | null, getBackendBaseUrl: () => string): _tanstack_react_query.UseQueryResult<NoInfer<{
|
|
3726
3765
|
catalogue: {
|
|
3727
3766
|
genreOnlyTracksCount: number;
|
|
@@ -3965,8 +4004,11 @@ interface UseGenreTreeViewStateOptions<O extends CriteriaOverview = CriteriaOver
|
|
|
3965
4004
|
viewMode?: GenreViewMode;
|
|
3966
4005
|
/** Projects this artist onto the tree (see `useVisibleGenrePlaylists`). */
|
|
3967
4006
|
artistUuid?: string | null;
|
|
3968
|
-
/**
|
|
3969
|
-
|
|
4007
|
+
/**
|
|
4008
|
+
* Entity selection is independent of the visible renderer nodes. It may be a raw URL value that names no
|
|
4009
|
+
* genre (malformed or missing); the detail panel shows it as not found.
|
|
4010
|
+
*/
|
|
4011
|
+
selectedGenreUuid?: string | null;
|
|
3970
4012
|
onSelectedGenreUuidChange?: (genreUuid: GenreUuid | null) => void;
|
|
3971
4013
|
criteriaOverviewSchema?: z.ZodType<O, unknown>;
|
|
3972
4014
|
}
|
|
@@ -3984,7 +4026,7 @@ interface UseGenreTreeViewStateResult {
|
|
|
3984
4026
|
/** Playlists the current view mode may show: unaccepted roots and, outside stacked/outline, criteria-less playlists are hidden. */
|
|
3985
4027
|
visibleGenrePlaylists: CriteriaPlaylistSimple[];
|
|
3986
4028
|
groupedGenrePlaylistsByRoot: Record<string, CriteriaPlaylistSimple[]>;
|
|
3987
|
-
selectedGenreUuid:
|
|
4029
|
+
selectedGenreUuid: string | null;
|
|
3988
4030
|
selectedNodeId: string | null;
|
|
3989
4031
|
selectGenre: (genreUuid: GenreUuid | null) => void;
|
|
3990
4032
|
selectedGenrePlaylist: CriteriaPlaylistSimple | undefined;
|
|
@@ -4019,7 +4061,7 @@ interface UseVisibleGenrePlaylistsOptions {
|
|
|
4019
4061
|
* carries the artist's counts and `focusUuids` names their footprint (undefined otherwise); genres
|
|
4020
4062
|
* outside it stay navigable and renderers draw them muted. While the artist's counts load the
|
|
4021
4063
|
* current tree stays (with the previous artist's projection) and `isFetching` is true; `isLoading`
|
|
4022
|
-
* is true only until the first tree arrives. If the counts fail (unknown artist, backend error) the
|
|
4064
|
+
* is true only until the first tree arrives. If the counts fail (unknown or malformed artist, backend error) the
|
|
4023
4065
|
* plain tree is served, the artist panel being where that failure is shown.
|
|
4024
4066
|
*/
|
|
4025
4067
|
declare function useVisibleGenrePlaylists({ scope, getBackendBaseUrl, artistUuid }: UseVisibleGenrePlaylistsOptions): {
|
|
@@ -4398,6 +4440,11 @@ type RenderSongLink = (song: {
|
|
|
4398
4440
|
title: string;
|
|
4399
4441
|
}) => ReactNode;
|
|
4400
4442
|
|
|
4443
|
+
/** Renders an artist's origin place as a link to its map region — typically the consumer's router `Link`. Only called when the origin has a `regionId`. */
|
|
4444
|
+
type RenderPlaceLink = (origin: ArtistOrigin & {
|
|
4445
|
+
regionId: string;
|
|
4446
|
+
}) => ReactNode;
|
|
4447
|
+
|
|
4401
4448
|
declare const UuidResourceSchema: z.ZodObject<{
|
|
4402
4449
|
uuid: z.ZodString;
|
|
4403
4450
|
}, z.core.$strip>;
|
|
@@ -5003,4 +5050,4 @@ declare const ReferenceGenrePlaylistSchema: z.ZodObject<{
|
|
|
5003
5050
|
type ReferenceGenreDetailed = z.infer<typeof ReferenceGenreDetailedSchema>;
|
|
5004
5051
|
type ReferenceGenrePlaylist = z.infer<typeof ReferenceGenrePlaylistSchema>;
|
|
5005
5052
|
|
|
5006
|
-
export { ARTIST_LINK_KINDS, type AlbumMinimum, AlbumMinimumSchema, type ArtistAlbum, type ArtistDetailed, ArtistDetailedSchema, type ArtistGenreCount, ArtistGenreCountSchema, type ArtistGenreProjection, type ArtistImage, ArtistImageSchema, type ArtistLink, type ArtistMembership, type ArtistMinimum, ArtistMinimumSchema, ArtistNames, type ArtistSearchResult, ArtistSearchResultSchema, ArtistSearchResultsSchema, type ArtistSongsOrdering, type ArtistTrackListOriginInput, CriteriaCreationSchema, type CriteriaCreationValues, type CriteriaDetailed, CriteriaDetailedSchema, type CriteriaLineageRelWithoutAscendant, CriteriaLineageRelWithoutAscendantSchema, type CriteriaLineageRelWithoutDescendant, CriteriaLineageRelWithoutDescendantSchema, type CriteriaMinimum, CriteriaMinimumSchema, type CriteriaOverview, CriteriaOverviewSchema, type CriteriaPlaylistDetailed, CriteriaPlaylistDetailedSchema, type CriteriaPlaylistMinimum, CriteriaPlaylistMinimumSchema, type CriteriaPlaylistSimple, CriteriaPlaylistSimpleSchema, type CriteriaSimple, CriteriaSimpleSchema, CriteriaUpdateSchema, type CriteriaUpdateValues, FORM_RATING_NULL_VALUE, FUZZY_MIN_SIMILARITY, type GenreCatalogueCounts, GenreCatalogueCountsSchema, GenreCountsSchema, type GenreCoverage, GenreCoverageSchema, type GenreMusicCounts, type GenreMusicSelection, type GenrePlaylistSummary, GenrePlaylistSummarySchema, type GenrePlaylistTracksPage, GenrePlaylistUuid, type GenreSearchParams, type GenreSearchResult, GenreSearchResultSchema, GenreSearchResultsSchema, type GenreSearchTreeName, GenreSearchTreeNameSchema, GenreUuid, type GenreViewMode, MbArtistDetailedSchema, MbRecordingDetailedSchema, type MusicbrainzArtistDetailed, type MusicbrainzRecordingDetailed, NO_VIDEO_LABEL, type NameIndex, type PlayArtistOptions, type PlayGenrePlaylistOptions, type ReferenceGenreDetailed, ReferenceGenreDetailedSchema, type ReferenceGenrePlaylist, ReferenceGenrePlaylistSchema, type RegionGenreLexiconEntry, RegionGenreLexiconEntrySchema, RegionGenreLexiconSchema, type RenderArtistLink, type RenderSongLink, type ReparentCandidate, SEARCH_DEBOUNCE_MS, SEARCH_QUERY_MIN_LENGTH, type SongDetailed, SongDetailedSchema, type SongHistoryEntry, SongHistoryEntrySchema, SongHistorySchema, type SongSearchGenreFilter, type SongSearchParams, type SongSearchResult, SongSearchResultSchema, SongSearchResultsSchema, SubgenreCountsSchema, type SubgenreScope, SubgenreScopeSchema, type TrackBase, TrackBaseSchema, TrackList, TrackListFromArtist, TrackListFromCriteriaPlaylist, TrackListFromTrack, TrackListOrigin, TrackListOriginFromArtist, TrackListOriginFromCriteriaPlaylist, TrackListOriginFromGenreCatalogue, TrackListOriginFromTrack, TrackListOriginType, TrackListProvider, TrackListSidebarVisibilityProvider, type TrackMinimum, TrackMinimumSchema, type TrackPlaylistRel, TracksFailureAlreadyReportedError, type UseArtistResult, type UseArtistSearchResult, type UseGenreRemoteSearchOptions, type UseGenreRemoteSearchResult, type UseGenreSearchOptions, type UseGenreSearchResult, type UseGenreTreeViewStateOptions, type UseGenreTreeViewStateResult, type UseRemoteSearchOptions, type UseRemoteSearchResult, type UseSearchQueryStateOptions, type UseSearchQueryStateResult, type UseSongHistoryResult, type UseSongResult, type UseSongSearchResult, type UseVisibleGenrePlaylistsOptions, type UuidResource, UuidResourceSchema, YOUTUBE_UNPLAYABLE_REASON_LABELS, YoutubeAvailabilitySchema, type YoutubeUnplayableReason, artistEndpoints, artistQueryKeys, capitalizeFirstLetter, createNameIndex, defaultGenreMusicSelection, editGenreSongPages, foldSearchText, formatTime, genreEndpoints, genreMusicCount, genreMusicQueryParams, genreMusicSelectionKey, genrePlaylistEndpoints, genrePlaylistQueryKeys, genrePlaylistTrackCount, genreQueryKeys, genreSearchQueryKeys, genreUpdateMutationKey, getGenrePlaylistsGroupedByRoot, getReparentCandidates, hasMainstreamPopRoot, isSong, isSongSearchResultPlayable, libraryEndpoints, libraryQueryKeys, makeTrackPlaylistRelPageSchema, makeTrackPlaylistRelSchema, musicBrainzRecordingUrl, projectGenrePlaylistsForArtist, rankByName, rankNameIndex, searchGenrePlaylistsByName, songUnplayableReason, trigramSimilarity, useArtist, useArtistGenreCounts, useArtistSearch, useCreateGenre, useDeleteGenre, useFetchGenre, useFetchGenreDetail, useFetchGenreOverview, useFetchGenrePlaylist, useGenreByWikidataId, useGenreRemoteSearch, useGenreSearch, useGenreTreeViewState, useInvalidateAllGenrePlaylistQueries, useListFullGenrePlaylists, useListGenrePlaylists, useListGenres, useListTracks, usePrefetchGenreOverview, useRegionGenreLexicon, useRemoteSearch, useSearchQueryState, useSong, useSongHistory, useSongSearch, useTrackList, useTrackListSidebarVisibility, useUpdateGenre, useVisibleGenrePlaylists };
|
|
5053
|
+
export { ARTIST_LINK_KINDS, type AlbumMinimum, AlbumMinimumSchema, type ArtistAlbum, type ArtistDetailed, ArtistDetailedSchema, type ArtistGenreCount, ArtistGenreCountSchema, type ArtistGenreProjection, type ArtistImage, ArtistImageSchema, type ArtistLink, type ArtistMembership, type ArtistMinimum, ArtistMinimumSchema, ArtistNames, type ArtistOrigin, ArtistOriginSchema, type ArtistSearchResult, ArtistSearchResultSchema, ArtistSearchResultsSchema, type ArtistSongsOrdering, type ArtistTrackListOriginInput, type CommonsImage, CommonsImageSchema, CriteriaCreationSchema, type CriteriaCreationValues, type CriteriaDetailed, CriteriaDetailedSchema, type CriteriaLineageRelWithoutAscendant, CriteriaLineageRelWithoutAscendantSchema, type CriteriaLineageRelWithoutDescendant, CriteriaLineageRelWithoutDescendantSchema, type CriteriaMinimum, CriteriaMinimumSchema, type CriteriaOverview, CriteriaOverviewSchema, type CriteriaPlaylistDetailed, CriteriaPlaylistDetailedSchema, type CriteriaPlaylistMinimum, CriteriaPlaylistMinimumSchema, type CriteriaPlaylistSimple, CriteriaPlaylistSimpleSchema, type CriteriaSimple, CriteriaSimpleSchema, CriteriaUpdateSchema, type CriteriaUpdateValues, FORM_RATING_NULL_VALUE, FUZZY_MIN_SIMILARITY, type GenreCatalogueCounts, GenreCatalogueCountsSchema, GenreCountsSchema, type GenreCoverage, GenreCoverageSchema, type GenreMusicCounts, type GenreMusicSelection, type GenrePlaylistSummary, GenrePlaylistSummarySchema, type GenrePlaylistTracksPage, GenrePlaylistUuid, type GenreSearchParams, type GenreSearchResult, GenreSearchResultSchema, GenreSearchResultsSchema, type GenreSearchTreeName, GenreSearchTreeNameSchema, GenreUuid, type GenreViewMode, MbArtistDetailedSchema, MbRecordingDetailedSchema, type MusicbrainzArtistDetailed, type MusicbrainzRecordingDetailed, NO_VIDEO_LABEL, type NameIndex, type PlayArtistOptions, type PlayGenrePlaylistOptions, type ReferenceGenreDetailed, ReferenceGenreDetailedSchema, type ReferenceGenrePlaylist, ReferenceGenrePlaylistSchema, type RegionGenreLexiconEntry, RegionGenreLexiconEntrySchema, RegionGenreLexiconSchema, type RenderArtistLink, type RenderPlaceLink, type RenderSongLink, type ReparentCandidate, SEARCH_DEBOUNCE_MS, SEARCH_QUERY_MIN_LENGTH, type SongDetailed, SongDetailedSchema, type SongHistoryEntry, SongHistoryEntrySchema, SongHistorySchema, type SongSearchGenreFilter, type SongSearchParams, type SongSearchResult, SongSearchResultSchema, SongSearchResultsSchema, SubgenreCountsSchema, type SubgenreScope, SubgenreScopeSchema, type TrackBase, TrackBaseSchema, TrackList, TrackListFromArtist, TrackListFromCriteriaPlaylist, TrackListFromTrack, TrackListOrigin, TrackListOriginFromArtist, TrackListOriginFromCriteriaPlaylist, TrackListOriginFromGenreCatalogue, TrackListOriginFromTrack, TrackListOriginType, TrackListProvider, TrackListSidebarVisibilityProvider, type TrackMinimum, TrackMinimumSchema, type TrackPlaylistRel, TracksFailureAlreadyReportedError, type UseArtistResult, type UseArtistSearchResult, type UseGenreRemoteSearchOptions, type UseGenreRemoteSearchResult, type UseGenreResult, type UseGenreSearchOptions, type UseGenreSearchResult, type UseGenreTreeViewStateOptions, type UseGenreTreeViewStateResult, type UseRemoteSearchOptions, type UseRemoteSearchResult, type UseSearchQueryStateOptions, type UseSearchQueryStateResult, type UseSongHistoryResult, type UseSongResult, type UseSongSearchResult, type UseVisibleGenrePlaylistsOptions, type UuidResource, UuidResourceSchema, YOUTUBE_UNPLAYABLE_REASON_LABELS, YoutubeAvailabilitySchema, type YoutubeUnplayableReason, artistEndpoints, artistQueryKeys, capitalizeFirstLetter, createNameIndex, defaultGenreMusicSelection, editGenreSongPages, foldSearchText, formatTime, genreEndpoints, genreMusicCount, genreMusicQueryParams, genreMusicSelectionKey, genrePlaylistEndpoints, genrePlaylistQueryKeys, genrePlaylistTrackCount, genreQueryKeys, genreSearchQueryKeys, genreUpdateMutationKey, getGenrePlaylistsGroupedByRoot, getReparentCandidates, hasMainstreamPopRoot, isSong, isSongSearchResultPlayable, libraryEndpoints, libraryQueryKeys, makeTrackPlaylistRelPageSchema, makeTrackPlaylistRelSchema, musicBrainzRecordingUrl, projectGenrePlaylistsForArtist, rankByName, rankNameIndex, searchGenrePlaylistsByName, songUnplayableReason, trigramSimilarity, useArtist, useArtistGenreCounts, useArtistSearch, useCreateGenre, useDeleteGenre, useFetchGenre, useFetchGenreDetail, useFetchGenreOverview, useFetchGenrePlaylist, useGenreByWikidataId, useGenreRemoteSearch, useGenreSearch, useGenreTreeViewState, useInvalidateAllGenrePlaylistQueries, useListFullGenrePlaylists, useListGenrePlaylists, useListGenres, useListTracks, usePrefetchGenreOverview, useRegionGenreLexicon, useRemoteSearch, useSearchQueryState, useSong, useSongHistory, useSongSearch, useTrackList, useTrackListSidebarVisibility, useUpdateGenre, useVisibleGenrePlaylists };
|
package/dist/genre-tree/index.js
CHANGED
|
@@ -6,8 +6,10 @@ import {
|
|
|
6
6
|
ArtistImageSchema,
|
|
7
7
|
ArtistMinimumSchema,
|
|
8
8
|
ArtistNames,
|
|
9
|
+
ArtistOriginSchema,
|
|
9
10
|
ArtistSearchResultSchema,
|
|
10
11
|
ArtistSearchResultsSchema,
|
|
12
|
+
CommonsImageSchema,
|
|
11
13
|
CriteriaCreationSchema,
|
|
12
14
|
CriteriaDetailedSchema,
|
|
13
15
|
CriteriaLineageRelWithoutAscendantSchema,
|
|
@@ -125,16 +127,21 @@ import {
|
|
|
125
127
|
useTrackListSidebarVisibility,
|
|
126
128
|
useUpdateGenre,
|
|
127
129
|
useVisibleGenrePlaylists
|
|
128
|
-
} from "../chunk-
|
|
129
|
-
import "../chunk-
|
|
130
|
-
import "../chunk-
|
|
131
|
-
import "../chunk-
|
|
130
|
+
} from "../chunk-QNBZQZEL.js";
|
|
131
|
+
import "../chunk-WHJNRJRZ.js";
|
|
132
|
+
import "../chunk-3Y7RT7QF.js";
|
|
133
|
+
import "../chunk-MPTID5ZR.js";
|
|
132
134
|
import "../chunk-MAKY4YBN.js";
|
|
133
135
|
import "../chunk-W4QTTNNA.js";
|
|
134
136
|
import {
|
|
137
|
+
ArtistUuidSchema,
|
|
135
138
|
GenrePlaylistUuidSchema,
|
|
136
|
-
GenreUuidSchema
|
|
137
|
-
|
|
139
|
+
GenreUuidSchema,
|
|
140
|
+
SongUuidSchema,
|
|
141
|
+
toArtistUuid,
|
|
142
|
+
toGenreUuid,
|
|
143
|
+
toSongUuid
|
|
144
|
+
} from "../chunk-RGHDVBEY.js";
|
|
138
145
|
export {
|
|
139
146
|
ARTIST_LINK_KINDS,
|
|
140
147
|
AlbumMinimumSchema,
|
|
@@ -143,8 +150,11 @@ export {
|
|
|
143
150
|
ArtistImageSchema,
|
|
144
151
|
ArtistMinimumSchema,
|
|
145
152
|
ArtistNames,
|
|
153
|
+
ArtistOriginSchema,
|
|
146
154
|
ArtistSearchResultSchema,
|
|
147
155
|
ArtistSearchResultsSchema,
|
|
156
|
+
ArtistUuidSchema,
|
|
157
|
+
CommonsImageSchema,
|
|
148
158
|
CriteriaCreationSchema,
|
|
149
159
|
CriteriaDetailedSchema,
|
|
150
160
|
CriteriaLineageRelWithoutAscendantSchema,
|
|
@@ -181,6 +191,7 @@ export {
|
|
|
181
191
|
SongHistorySchema,
|
|
182
192
|
SongSearchResultSchema,
|
|
183
193
|
SongSearchResultsSchema,
|
|
194
|
+
SongUuidSchema,
|
|
184
195
|
SubgenreCountsSchema,
|
|
185
196
|
SubgenreScopeSchema,
|
|
186
197
|
TrackBaseSchema,
|
|
@@ -234,6 +245,9 @@ export {
|
|
|
234
245
|
rankNameIndex,
|
|
235
246
|
searchGenrePlaylistsByName,
|
|
236
247
|
songUnplayableReason,
|
|
248
|
+
toArtistUuid,
|
|
249
|
+
toGenreUuid,
|
|
250
|
+
toSongUuid,
|
|
237
251
|
trigramSimilarity,
|
|
238
252
|
useArtist,
|
|
239
253
|
useArtistGenreCounts,
|
|
@@ -29,6 +29,17 @@ module.exports = __toCommonJS(testing_exports);
|
|
|
29
29
|
var import_zod = require("zod");
|
|
30
30
|
var GenreUuidSchema = import_zod.z.string().uuid().brand();
|
|
31
31
|
var GenrePlaylistUuidSchema = import_zod.z.string().uuid().brand();
|
|
32
|
+
var ArtistUuidSchema = import_zod.z.string().uuid().brand();
|
|
33
|
+
var SongUuidSchema = import_zod.z.string().uuid().brand();
|
|
34
|
+
function toId(schema) {
|
|
35
|
+
return (value) => {
|
|
36
|
+
const parsed = schema.safeParse(value);
|
|
37
|
+
return parsed.success ? parsed.data : null;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
var toGenreUuid = toId(GenreUuidSchema);
|
|
41
|
+
var toArtistUuid = toId(ArtistUuidSchema);
|
|
42
|
+
var toSongUuid = toId(SongUuidSchema);
|
|
32
43
|
|
|
33
44
|
// src/genre-tree/testing.ts
|
|
34
45
|
var UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/genre-tree/testing.ts","../../src/genre-tree/schemas/ids.ts"],"sourcesContent":["import { GenrePlaylistUuidSchema, GenreUuidSchema, type GenrePlaylistUuid, type GenreUuid } from \"./schemas/ids\";\n\n// Test fixtures only. A readable name (\"jazz\") maps to a stable UUID, so the same name yields the same id across runs.\n// Genre and playlist names are salted apart so the two id spaces never collide.\nconst UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;\n\nfunction fnv1a(input: string, offsetBasis: number): number {\n let hash = offsetBasis;\n for (let index = 0; index < input.length; index++) {\n hash ^= input.charCodeAt(index);\n hash = Math.imul(hash, 0x01000193);\n }\n return hash >>> 0;\n}\n\nfunction nameToUuid(salt: string, name: string): string {\n const hex = [0x811c9dc5, 0x01000193, 0x5bd1e995, 0x27d4eb2f]\n .map((offsetBasis) => fnv1a(`${salt}:${name}`, offsetBasis).toString(16).padStart(8, \"0\"))\n .join(\"\");\n const variant = ((parseInt(hex[16], 16) & 0x3) | 0x8).toString(16);\n return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-4${hex.slice(13, 16)}-${variant}${hex.slice(17, 20)}-${hex.slice(20, 32)}`;\n}\n\nexport const makeGenreUuid = (value: string): GenreUuid =>\n GenreUuidSchema.parse(UUID_PATTERN.test(value) ? value : nameToUuid(\"genre\", value));\n\nexport const makeGenrePlaylistUuid = (value: string): GenrePlaylistUuid =>\n GenrePlaylistUuidSchema.parse(UUID_PATTERN.test(value) ? value : nameToUuid(\"genre-playlist\", value));\n","import { z } from \"zod\";\n\n// A genre (criteria) and its genre playlist are 1:1 but live in distinct UUID spaces: `genres/{uuid}/`\n// takes the former, `genre-playlists/{uuid}/` the latter. Branding makes mixing them a compile error.\nexport const GenreUuidSchema = z.string().uuid().brand<\"GenreUuid\">();\nexport const GenrePlaylistUuidSchema = z.string().uuid().brand<\"GenrePlaylistUuid\">();\n\nexport type GenreUuid = z.infer<typeof GenreUuidSchema>;\nexport type GenrePlaylistUuid = z.infer<typeof GenrePlaylistUuidSchema>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,iBAAkB;AAIX,IAAM,kBAAkB,aAAE,OAAO,EAAE,KAAK,EAAE,MAAmB;AAC7D,IAAM,0BAA0B,aAAE,OAAO,EAAE,KAAK,EAAE,MAA2B;;;
|
|
1
|
+
{"version":3,"sources":["../../src/genre-tree/testing.ts","../../src/genre-tree/schemas/ids.ts"],"sourcesContent":["import { GenrePlaylistUuidSchema, GenreUuidSchema, type GenrePlaylistUuid, type GenreUuid } from \"./schemas/ids\";\n\n// Test fixtures only. A readable name (\"jazz\") maps to a stable UUID, so the same name yields the same id across runs.\n// Genre and playlist names are salted apart so the two id spaces never collide.\nconst UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;\n\nfunction fnv1a(input: string, offsetBasis: number): number {\n let hash = offsetBasis;\n for (let index = 0; index < input.length; index++) {\n hash ^= input.charCodeAt(index);\n hash = Math.imul(hash, 0x01000193);\n }\n return hash >>> 0;\n}\n\nfunction nameToUuid(salt: string, name: string): string {\n const hex = [0x811c9dc5, 0x01000193, 0x5bd1e995, 0x27d4eb2f]\n .map((offsetBasis) => fnv1a(`${salt}:${name}`, offsetBasis).toString(16).padStart(8, \"0\"))\n .join(\"\");\n const variant = ((parseInt(hex[16], 16) & 0x3) | 0x8).toString(16);\n return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-4${hex.slice(13, 16)}-${variant}${hex.slice(17, 20)}-${hex.slice(20, 32)}`;\n}\n\nexport const makeGenreUuid = (value: string): GenreUuid =>\n GenreUuidSchema.parse(UUID_PATTERN.test(value) ? value : nameToUuid(\"genre\", value));\n\nexport const makeGenrePlaylistUuid = (value: string): GenrePlaylistUuid =>\n GenrePlaylistUuidSchema.parse(UUID_PATTERN.test(value) ? value : nameToUuid(\"genre-playlist\", value));\n","import { z } from \"zod\";\n\n// A genre (criteria) and its genre playlist are 1:1 but live in distinct UUID spaces: `genres/{uuid}/`\n// takes the former, `genre-playlists/{uuid}/` the latter. Branding makes mixing them a compile error.\nexport const GenreUuidSchema = z.string().uuid().brand<\"GenreUuid\">();\nexport const GenrePlaylistUuidSchema = z.string().uuid().brand<\"GenrePlaylistUuid\">();\n\nexport const ArtistUuidSchema = z.string().uuid().brand<\"ArtistUuid\">();\nexport const SongUuidSchema = z.string().uuid().brand<\"SongUuid\">();\n\nexport type GenreUuid = z.infer<typeof GenreUuidSchema>;\nexport type GenrePlaylistUuid = z.infer<typeof GenrePlaylistUuidSchema>;\nexport type ArtistUuid = z.infer<typeof ArtistUuidSchema>;\nexport type SongUuid = z.infer<typeof SongUuidSchema>;\n\nfunction toId<S extends z.ZodType<string>>(schema: S) {\n return (value: string | null): z.infer<S> | null => {\n const parsed = schema.safeParse(value);\n return parsed.success ? parsed.data : null;\n };\n}\n\n/** The id as a `GenreUuid`, or null when it is absent or malformed (e.g. a raw URL value). */\nexport const toGenreUuid = toId(GenreUuidSchema);\n\n/** The id as an `ArtistUuid`, or null when it is absent or malformed (e.g. a raw URL value). */\nexport const toArtistUuid = toId(ArtistUuidSchema);\n\n/** The id as a `SongUuid`, or null when it is absent or malformed (e.g. a raw URL value). */\nexport const toSongUuid = toId(SongUuidSchema);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,iBAAkB;AAIX,IAAM,kBAAkB,aAAE,OAAO,EAAE,KAAK,EAAE,MAAmB;AAC7D,IAAM,0BAA0B,aAAE,OAAO,EAAE,KAAK,EAAE,MAA2B;AAE7E,IAAM,mBAAmB,aAAE,OAAO,EAAE,KAAK,EAAE,MAAoB;AAC/D,IAAM,iBAAiB,aAAE,OAAO,EAAE,KAAK,EAAE,MAAkB;AAOlE,SAAS,KAAkC,QAAW;AACpD,SAAO,CAAC,UAA4C;AAClD,UAAM,SAAS,OAAO,UAAU,KAAK;AACrC,WAAO,OAAO,UAAU,OAAO,OAAO;AAAA,EACxC;AACF;AAGO,IAAM,cAAc,KAAK,eAAe;AAGxC,IAAM,eAAe,KAAK,gBAAgB;AAG1C,IAAM,aAAa,KAAK,cAAc;;;ADzB7C,IAAM,eAAe;AAErB,SAAS,MAAM,OAAe,aAA6B;AACzD,MAAI,OAAO;AACX,WAAS,QAAQ,GAAG,QAAQ,MAAM,QAAQ,SAAS;AACjD,YAAQ,MAAM,WAAW,KAAK;AAC9B,WAAO,KAAK,KAAK,MAAM,QAAU;AAAA,EACnC;AACA,SAAO,SAAS;AAClB;AAEA,SAAS,WAAW,MAAc,MAAsB;AACtD,QAAM,MAAM,CAAC,YAAY,UAAY,YAAY,SAAU,EACxD,IAAI,CAAC,gBAAgB,MAAM,GAAG,IAAI,IAAI,IAAI,IAAI,WAAW,EAAE,SAAS,EAAE,EAAE,SAAS,GAAG,GAAG,CAAC,EACxF,KAAK,EAAE;AACV,QAAM,WAAY,SAAS,IAAI,EAAE,GAAG,EAAE,IAAI,IAAO,GAAK,SAAS,EAAE;AACjE,SAAO,GAAG,IAAI,MAAM,GAAG,CAAC,CAAC,IAAI,IAAI,MAAM,GAAG,EAAE,CAAC,KAAK,IAAI,MAAM,IAAI,EAAE,CAAC,IAAI,OAAO,GAAG,IAAI,MAAM,IAAI,EAAE,CAAC,IAAI,IAAI,MAAM,IAAI,EAAE,CAAC;AACzH;AAEO,IAAM,gBAAgB,CAAC,UAC5B,gBAAgB,MAAM,aAAa,KAAK,KAAK,IAAI,QAAQ,WAAW,SAAS,KAAK,CAAC;AAE9E,IAAM,wBAAwB,CAAC,UACpC,wBAAwB,MAAM,aAAa,KAAK,KAAK,IAAI,QAAQ,WAAW,kBAAkB,KAAK,CAAC;","names":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
declare const GenreUuidSchema: z.core.$ZodBranded<z.ZodString, "GenreUuid", "out">;
|
|
4
|
+
declare const GenrePlaylistUuidSchema: z.core.$ZodBranded<z.ZodString, "GenrePlaylistUuid", "out">;
|
|
5
|
+
declare const ArtistUuidSchema: z.core.$ZodBranded<z.ZodString, "ArtistUuid", "out">;
|
|
6
|
+
declare const SongUuidSchema: z.core.$ZodBranded<z.ZodString, "SongUuid", "out">;
|
|
7
|
+
type GenreUuid = z.infer<typeof GenreUuidSchema>;
|
|
8
|
+
type GenrePlaylistUuid = z.infer<typeof GenrePlaylistUuidSchema>;
|
|
9
|
+
type ArtistUuid = z.infer<typeof ArtistUuidSchema>;
|
|
10
|
+
type SongUuid = z.infer<typeof SongUuidSchema>;
|
|
11
|
+
/** The id as a `GenreUuid`, or null when it is absent or malformed (e.g. a raw URL value). */
|
|
12
|
+
declare const toGenreUuid: (value: string | null) => (string & z.core.$brand<"GenreUuid">) | null;
|
|
13
|
+
/** The id as an `ArtistUuid`, or null when it is absent or malformed (e.g. a raw URL value). */
|
|
14
|
+
declare const toArtistUuid: (value: string | null) => (string & z.core.$brand<"ArtistUuid">) | null;
|
|
15
|
+
/** The id as a `SongUuid`, or null when it is absent or malformed (e.g. a raw URL value). */
|
|
16
|
+
declare const toSongUuid: (value: string | null) => (string & z.core.$brand<"SongUuid">) | null;
|
|
17
|
+
|
|
18
|
+
export { type ArtistUuid as A, type GenrePlaylistUuid as G, type SongUuid as S, ArtistUuidSchema as a, GenrePlaylistUuidSchema as b, type GenreUuid as c, GenreUuidSchema as d, SongUuidSchema as e, toGenreUuid as f, toSongUuid as g, toArtistUuid as t };
|