@behindthemusictree/app-kit-ui 32.0.3 → 33.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/dist/{chunk-QGGVPIXY.js → chunk-2M4Q2IJU.js} +28 -16
- package/dist/chunk-2M4Q2IJU.js.map +1 -0
- package/dist/{chunk-XUC4UJDQ.js → chunk-K4WMHUNM.js} +7 -4
- package/dist/chunk-K4WMHUNM.js.map +1 -0
- package/dist/genre-tree/index.cjs +25 -13
- package/dist/genre-tree/index.cjs.map +1 -1
- package/dist/genre-tree/index.js +1 -1
- package/dist/index.cjs +47 -32
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -2
- package/dist/popup/index.cjs +8 -5
- package/dist/popup/index.cjs.map +1 -1
- package/dist/popup/index.d.ts +4 -2
- package/dist/popup/index.js +1 -1
- package/package.json +3 -3
- package/dist/chunk-QGGVPIXY.js.map +0 -1
- package/dist/chunk-XUC4UJDQ.js.map +0 -1
|
@@ -554,7 +554,7 @@ function GenreSearch({
|
|
|
554
554
|
onPick: handlePick,
|
|
555
555
|
status,
|
|
556
556
|
loading: loading ? "Searching\u2026" : void 0,
|
|
557
|
-
inputClassName: `h-[var(--layout-search-h,3rem)] ${onPrevious ? "pl-11" : "pl-6"} pr-20 text-base transition-[padding] duration-200 ease-out motion-reduce:transition-none bg-[var(--color-surface)] border-[var(--color-border)] rounded-full shadow-md`,
|
|
557
|
+
inputClassName: `h-[var(--layout-search-h,3rem)] ${onPrevious ? "pl-11" : "pl-6"} pr-20 text-base transition-[padding] duration-200 ease-out motion-reduce:transition-none bg-[var(--color-surface)] border-[var(--color-border)] rounded-full shadow-md focus-visible:ring-0`,
|
|
558
558
|
className: "genre-search-results z-40 rounded-xl shadow-md",
|
|
559
559
|
listClassName: "max-h-[min(20rem,50dvh)]",
|
|
560
560
|
optionClassName: "[@media(pointer:coarse)]:min-h-[var(--layout-touch-target)]"
|
|
@@ -953,7 +953,7 @@ import { z } from "zod";
|
|
|
953
953
|
import { FaPlay, FaPause } from "react-icons/fa";
|
|
954
954
|
import { PanelSection, RingLoader, Skeleton } from "@behindthemusictree/ui";
|
|
955
955
|
import { useSession } from "@behindthemusictree/app-kit/auth";
|
|
956
|
-
import { useFetchWrapper } from "@behindthemusictree/app-kit/transport";
|
|
956
|
+
import { usePlaybackContext, useFetchWrapper } from "@behindthemusictree/app-kit/transport";
|
|
957
957
|
import { PaginatedResponseSchema } from "@behindthemusictree/app-kit/transport";
|
|
958
958
|
import { parseWithLog } from "@behindthemusictree/app-kit/transport";
|
|
959
959
|
import { usePlayer as usePlayer4 } from "@behindthemusictree/app-kit/player";
|
|
@@ -1028,8 +1028,9 @@ function GenrePlaylistTracks({
|
|
|
1028
1028
|
const trackNoun = useTrackNoun();
|
|
1029
1029
|
const { uuid } = genrePlaylist;
|
|
1030
1030
|
const { fetch } = useFetchWrapper(getBackendBaseUrl);
|
|
1031
|
+
const playback = usePlaybackContext();
|
|
1031
1032
|
const { data, isPending, isError, refetch, hasNextPage, isFetchingNextPage, fetchNextPage } = useInfiniteQuery({
|
|
1032
|
-
queryKey: scope === "me" ? genrePlaylistQueryKeys.me.tracks(uuid) : artist ? [...libraryQueryKeys.reference.songs.byGenre(getBackendBaseUrl(), genreUuid), "artist", artist.uuid] : libraryQueryKeys.reference.songs.byGenre(getBackendBaseUrl(), genreUuid),
|
|
1033
|
+
queryKey: [...scope === "me" ? genrePlaylistQueryKeys.me.tracks(uuid) : artist ? [...libraryQueryKeys.reference.songs.byGenre(getBackendBaseUrl(), genreUuid), "artist", artist.uuid] : libraryQueryKeys.reference.songs.byGenre(getBackendBaseUrl(), genreUuid), ...playback.key ? [playback.key] : []],
|
|
1033
1034
|
queryFn: async ({ pageParam }) => {
|
|
1034
1035
|
if (scope === "me") return fetchGenrePlaylistTracksPage(uuid, scope, Number(pageParam));
|
|
1035
1036
|
const response = await fetch(
|
|
@@ -1044,7 +1045,7 @@ function GenrePlaylistTracks({
|
|
|
1044
1045
|
},
|
|
1045
1046
|
initialPageParam: scope === "me" ? 1 : "",
|
|
1046
1047
|
getNextPageParam: (lastPage) => lastPage.nextPage ?? void 0,
|
|
1047
|
-
enabled: scope !== "me" || sessionRestored && !!session?.accessToken
|
|
1048
|
+
enabled: playback.ready && (scope !== "me" || sessionRestored && !!session?.accessToken)
|
|
1048
1049
|
});
|
|
1049
1050
|
const [sentinel, setSentinel] = useState5(null);
|
|
1050
1051
|
useEffect3(() => {
|
|
@@ -2341,7 +2342,10 @@ function GenreTreeView({
|
|
|
2341
2342
|
const ancestors = /* @__PURE__ */ jsx29(GenreNodeAncestors, { ancestorNodes: relation.ancestorNodes, onSelectNode: selectGenreFromPanel });
|
|
2342
2343
|
const genrePlaylist = genrePlaylistByNodeId.get(node.id);
|
|
2343
2344
|
const criteria = genrePlaylist?.criteria;
|
|
2344
|
-
if (!genrePlaylist || !criteria) return { primary:
|
|
2345
|
+
if (!genrePlaylist || !criteria) return { primary: /* @__PURE__ */ jsxs22(Fragment11, { children: [
|
|
2346
|
+
family,
|
|
2347
|
+
ancestors
|
|
2348
|
+
] }) };
|
|
2345
2349
|
const genreUuid = criteria.uuid;
|
|
2346
2350
|
const parentPlaylist = visibleGenrePlaylists.find(({ uuid }) => uuid === genrePlaylist.parent?.uuid);
|
|
2347
2351
|
const canToggleSide = !readOnly && parentPlaylist !== void 0 && parentPlaylist.parent === null;
|
|
@@ -2362,7 +2366,10 @@ function GenreTreeView({
|
|
|
2362
2366
|
/* @__PURE__ */ jsx29(
|
|
2363
2367
|
GenreInfoPanelBody,
|
|
2364
2368
|
{
|
|
2365
|
-
family,
|
|
2369
|
+
family: /* @__PURE__ */ jsxs22(Fragment11, { children: [
|
|
2370
|
+
family,
|
|
2371
|
+
ancestors
|
|
2372
|
+
] }),
|
|
2366
2373
|
genreUuid,
|
|
2367
2374
|
genrePlaylist,
|
|
2368
2375
|
wikidataId: criteria.wikidataId,
|
|
@@ -2409,8 +2416,7 @@ function GenreTreeView({
|
|
|
2409
2416
|
}
|
|
2410
2417
|
),
|
|
2411
2418
|
renderDangerZone?.(node)
|
|
2412
|
-
] })
|
|
2413
|
-
aside: ancestors
|
|
2419
|
+
] })
|
|
2414
2420
|
};
|
|
2415
2421
|
};
|
|
2416
2422
|
const isRotationControlled = controlledAllowWheelRotation !== void 0;
|
|
@@ -2427,11 +2433,10 @@ function GenreTreeView({
|
|
|
2427
2433
|
compact: false
|
|
2428
2434
|
};
|
|
2429
2435
|
} else if (relations) {
|
|
2430
|
-
const { primary
|
|
2436
|
+
const { primary } = renderGenreBody(relations);
|
|
2431
2437
|
activePanel = {
|
|
2432
2438
|
title: relations.node.name,
|
|
2433
2439
|
content: primary,
|
|
2434
|
-
aside,
|
|
2435
2440
|
expanded: isExpanded,
|
|
2436
2441
|
onExpandedChange: changeExpanded,
|
|
2437
2442
|
onClose: clearSelection,
|
|
@@ -2720,7 +2725,7 @@ import { Maximize2 as Maximize22, Minimize2 as Minimize22 } from "lucide-react";
|
|
|
2720
2725
|
import {
|
|
2721
2726
|
useFetchGenreDetail
|
|
2722
2727
|
} from "@behindthemusictree/app-kit/genre-tree";
|
|
2723
|
-
import { jsx as jsx30, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
2728
|
+
import { Fragment as Fragment12, jsx as jsx30, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
2724
2729
|
var RELATIVE_ITEM_COUNT = 1;
|
|
2725
2730
|
function toNode(genre, parentId) {
|
|
2726
2731
|
return {
|
|
@@ -2817,12 +2822,14 @@ function GenreDetailPanel({
|
|
|
2817
2822
|
expanded,
|
|
2818
2823
|
onExpandedChange,
|
|
2819
2824
|
edgeTab,
|
|
2820
|
-
aside: ancestors,
|
|
2821
2825
|
children: [
|
|
2822
2826
|
/* @__PURE__ */ jsx30(
|
|
2823
2827
|
GenreInfoPanelBody,
|
|
2824
2828
|
{
|
|
2825
|
-
family,
|
|
2829
|
+
family: /* @__PURE__ */ jsxs23(Fragment12, { children: [
|
|
2830
|
+
family,
|
|
2831
|
+
ancestors
|
|
2832
|
+
] }),
|
|
2826
2833
|
genreUuid: detail.uuid,
|
|
2827
2834
|
genrePlaylist: { ...detail.criteriaPlaylist, tracksCount: detail.tracksCount },
|
|
2828
2835
|
wikidataId: detail.wikidataId,
|
|
@@ -3151,7 +3158,7 @@ function PlayerPanel({
|
|
|
3151
3158
|
renderArtistLink,
|
|
3152
3159
|
renderSongLink
|
|
3153
3160
|
}) {
|
|
3154
|
-
const { playerTrackObject } = usePlayer11();
|
|
3161
|
+
const { playerTrackObject, retryPlayback } = usePlayer11();
|
|
3155
3162
|
const { toggleTrackListSidebar, isTrackListSidebarVisible } = useTrackListSidebarVisibility();
|
|
3156
3163
|
const [lastLoadedTrackTitle, setLastLoadedTrackTitle] = useState9("");
|
|
3157
3164
|
const loadedTrackTitle = playerTrackObject?.track.title;
|
|
@@ -3214,7 +3221,12 @@ function PlayerPanel({
|
|
|
3214
3221
|
/* @__PURE__ */ jsx33("div", { className: "flex shrink-0 items-center justify-between gap-2 border-b border-zinc-800 p-2", children: /* @__PURE__ */ jsx33("span", { className: "min-w-0 truncate text-sm font-semibold", children: loadedTrackTitle || lastLoadedTrackTitle }) }),
|
|
3215
3222
|
/* @__PURE__ */ jsxs26("div", { className: "relative w-full shrink-0", children: [
|
|
3216
3223
|
/* @__PURE__ */ jsx33(PlayerVideoSurface, { className: "aspect-video w-full bg-black" }),
|
|
3217
|
-
playerTrackObject?.loadError && /* @__PURE__ */
|
|
3224
|
+
playerTrackObject?.loadError && /* @__PURE__ */ jsxs26("span", { className: "absolute bottom-2 left-2 right-2 text-xs text-red-400", children: [
|
|
3225
|
+
playerTrackObject.loadError,
|
|
3226
|
+
/* @__PURE__ */ jsx33("button", { type: "button", className: "ml-2 underline", onClick: () => {
|
|
3227
|
+
void retryPlayback();
|
|
3228
|
+
}, children: "Retry" })
|
|
3229
|
+
] })
|
|
3218
3230
|
] }),
|
|
3219
3231
|
/* @__PURE__ */ jsx33(PlayerControls, {})
|
|
3220
3232
|
] }),
|
|
@@ -3297,4 +3309,4 @@ export {
|
|
|
3297
3309
|
GenreTreeViewSkeleton2 as GenreTreeViewSkeleton,
|
|
3298
3310
|
GenreTreeOutlineSkeleton
|
|
3299
3311
|
};
|
|
3300
|
-
//# sourceMappingURL=chunk-
|
|
3312
|
+
//# sourceMappingURL=chunk-2M4Q2IJU.js.map
|