@behindthemusictree/app-kit-ui 33.2.0 → 34.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/{chunk-FHGQGTCN.js → chunk-A7OWCEIK.js} +88 -34
- package/dist/chunk-A7OWCEIK.js.map +1 -0
- package/dist/genre-tree/index.cjs +145 -100
- package/dist/genre-tree/index.cjs.map +1 -1
- package/dist/genre-tree/index.d.ts +11 -8
- package/dist/genre-tree/index.js +1 -1
- package/dist/index.cjs +145 -100
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +3 -3
- package/dist/chunk-FHGQGTCN.js.map +0 -1
|
@@ -3,7 +3,7 @@ import { ReactNode, ComponentProps } from 'react';
|
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import { GenreTreeProps, FocusChangeReason, GenreTreeNode, GenreTreeAction, GenreTreeViewMode, GenreTreeViewport, WheelZoomMode } from '@behindthemusictree/genre-tree-view';
|
|
5
5
|
export { FocusChangeReason, GenreTreeAction, GenreTreeOutlineSkeleton, GenreTreeSkeleton, GenreTreeViewMode, GenreTreeViewSkeleton, GenreTreeViewSkeletonProps, GenreTreeViewport, GenreTreeWheelSkeleton } from '@behindthemusictree/genre-tree-view';
|
|
6
|
-
import { TrackBase, CriteriaOverview, GenreUuid, CriteriaPlaylistMinimum, RenderArtistLink, RenderSongLink, CriteriaPlaylistSimple, ArtistSearchResult, SongSearchResult, UseGenreRemoteSearchOptions, GenreSearchResult, GenrePlaylistUuid, CriteriaMinimum } from '@behindthemusictree/app-kit/genre-tree';
|
|
6
|
+
import { TrackBase, CriteriaOverview, GenreUuid, CriteriaPlaylistMinimum, GenreMusicSelection, RenderArtistLink, RenderSongLink, CriteriaPlaylistSimple, ArtistSearchResult, SongSearchResult, UseGenreRemoteSearchOptions, GenreSearchResult, GenrePlaylistUuid, CriteriaMinimum, GenreCatalogueCounts, GenrePlaylistSummary } from '@behindthemusictree/app-kit/genre-tree';
|
|
7
7
|
import { Scope } from '@behindthemusictree/app-kit/transport';
|
|
8
8
|
import { DetailPanel } from '@behindthemusictree/ui';
|
|
9
9
|
|
|
@@ -25,6 +25,7 @@ type GenreDetailSlots<O extends CriteriaOverview> = {
|
|
|
25
25
|
type GenreDetailExtrasProps<O extends CriteriaOverview> = GenreDetailSlots<O> & GenrePlaylistTracksSlots & {
|
|
26
26
|
genreUuid: GenreUuid;
|
|
27
27
|
genrePlaylist: CriteriaPlaylistMinimum;
|
|
28
|
+
selection?: GenreMusicSelection;
|
|
28
29
|
wikidataId?: string | null;
|
|
29
30
|
scope: Scope;
|
|
30
31
|
getBackendBaseUrl: () => string;
|
|
@@ -60,11 +61,9 @@ type HostOverlayPanel = Omit<OverlayPanel, "expanded" | "onExpandedChange"> & {
|
|
|
60
61
|
/** The host-owned detail panel's contract with the tree: the area the panel covers, and the node-style resolver the tree publishes back. */
|
|
61
62
|
type HostPanelProps = Partial<Pick<GenreTreeProps, "obscuredInset" | "onNodeStyleResolverChange">>;
|
|
62
63
|
|
|
63
|
-
/** What a play button needs of a playlist; `criteria` is only read when playing one artist's songs in the genre. */
|
|
64
64
|
type PlayableGenrePlaylistInput = CriteriaPlaylistMinimum & {
|
|
65
65
|
criteria?: CriteriaPlaylistSimple["criteria"];
|
|
66
66
|
};
|
|
67
|
-
/** What a tree node's play button plays, and which node is the one currently playing. */
|
|
68
67
|
type GenrePlaylistPlayback = {
|
|
69
68
|
playingNodeId: string | null;
|
|
70
69
|
play: (genrePlaylist: PlayableGenrePlaylistInput) => Promise<void>;
|
|
@@ -72,7 +71,6 @@ type GenrePlaylistPlayback = {
|
|
|
72
71
|
type UseGenrePlaylistPlaybackOptions = {
|
|
73
72
|
scope: Scope;
|
|
74
73
|
genrePlaylists: CriteriaPlaylistSimple[];
|
|
75
|
-
/** When set, nodes play only this artist's songs in the genre's subtree instead of the whole genre playlist. */
|
|
76
74
|
artist?: {
|
|
77
75
|
uuid: string;
|
|
78
76
|
name: string;
|
|
@@ -227,6 +225,10 @@ type GenreTreeViewProps<O extends CriteriaOverview = CriteriaOverview> = {
|
|
|
227
225
|
readOnly?: boolean;
|
|
228
226
|
/** Further result groups (e.g. places) shown in the search box next to genres, artists and songs. */
|
|
229
227
|
extraSearchGroups?: SearchGroup[];
|
|
228
|
+
/** Fires with the typed search text (empty when cleared), so a host can drive its own `extraSearchGroups`. */
|
|
229
|
+
onSearchQueryChange?: (text: string) => void;
|
|
230
|
+
/** Fires when the search box gains focus, e.g. to load data for `extraSearchGroups` lazily. */
|
|
231
|
+
onSearchFocus?: () => void;
|
|
230
232
|
/** Root element classes; the component adds no outer margin. */
|
|
231
233
|
className?: string;
|
|
232
234
|
/** Shows the "Tree display options" group (e.g. Rotation). Defaults to true. */
|
|
@@ -286,7 +288,7 @@ type GenreTreeViewProps<O extends CriteriaOverview = CriteriaOverview> = {
|
|
|
286
288
|
collapsed?: boolean;
|
|
287
289
|
onCollapsedChange?: (collapsed: boolean) => void;
|
|
288
290
|
};
|
|
289
|
-
declare function GenreTreeView<O extends CriteriaOverview = CriteriaOverview>({ scope, handleGenreCreationAction, handleGenreRenameAction, onParentChanged, getBackendBaseUrl, additionalActions, viewMode: controlledViewMode, selectedNodeId: controlledSelectedNodeId, onSelectedNodeIdChange, defaultViewport, viewportRestore, onViewportChange, readOnly, className, showDisplayOptions, showAddRoot, allowWheelRotation: controlledAllowWheelRotation, criteriaOverviewSchema, renderGenreDetailExtras, floatingControlsLeading, sizeMetric: controlledSizeMetric, onSizeMetricChange, renderArtistLink, artistUuid: controlledArtistUuid, onArtistUuidChange, artistExpanded: controlledArtistExpanded, onArtistExpandedChange, getShareUrl, extraSearchGroups, artistSearch, onArtistSelect, artistSearchBaseUrl, songUuid: controlledSongUuid, onSongUuidChange, songExpanded: controlledSongExpanded, onSongExpandedChange, songSearch, onSongSelect, renderSongLink, renderSummary, renderEssentialTracks, renderSongLeading, renderSongActions, renderTracksToolbar, renderDangerZone, expanded, onExpandedChange, collapsed, onCollapsedChange, overlayPanel, placement, ...focus }: GenreTreeViewProps<O>): react.JSX.Element;
|
|
291
|
+
declare function GenreTreeView<O extends CriteriaOverview = CriteriaOverview>({ scope, handleGenreCreationAction, handleGenreRenameAction, onParentChanged, getBackendBaseUrl, additionalActions, viewMode: controlledViewMode, selectedNodeId: controlledSelectedNodeId, onSelectedNodeIdChange, defaultViewport, viewportRestore, onViewportChange, readOnly, className, showDisplayOptions, showAddRoot, allowWheelRotation: controlledAllowWheelRotation, criteriaOverviewSchema, renderGenreDetailExtras, floatingControlsLeading, sizeMetric: controlledSizeMetric, onSizeMetricChange, renderArtistLink, artistUuid: controlledArtistUuid, onArtistUuidChange, artistExpanded: controlledArtistExpanded, onArtistExpandedChange, getShareUrl, extraSearchGroups, onSearchQueryChange, onSearchFocus, artistSearch, onArtistSelect, artistSearchBaseUrl, songUuid: controlledSongUuid, onSongUuidChange, songExpanded: controlledSongExpanded, onSongExpandedChange, songSearch, onSongSelect, renderSongLink, renderSummary, renderEssentialTracks, renderSongLeading, renderSongActions, renderTracksToolbar, renderDangerZone, expanded, onExpandedChange, collapsed, onCollapsedChange, overlayPanel, placement, ...focus }: GenreTreeViewProps<O>): react.JSX.Element;
|
|
290
292
|
|
|
291
293
|
type GenreActionBandProps = {
|
|
292
294
|
node: GenreTreeNode;
|
|
@@ -313,9 +315,9 @@ type GenreActionBandProps = {
|
|
|
313
315
|
declare function GenreActionBand({ node, onPlayPause, isPlaying, onZoomIn, onAddChild, onRename, onChangeParent, side, onToggleSide, toggleSideDisabledReason, additionalActions, shareTarget, shareUrl, }: GenreActionBandProps): react.JSX.Element | null;
|
|
314
316
|
|
|
315
317
|
/** What the action band reads of a genre's playlist: enough to play it and to know whether it can be. */
|
|
316
|
-
type PlayableGenrePlaylist = CriteriaPlaylistMinimum & {
|
|
318
|
+
type PlayableGenrePlaylist = (CriteriaPlaylistMinimum & {
|
|
317
319
|
tracksCount: number;
|
|
318
|
-
};
|
|
320
|
+
}) | GenrePlaylistSummary;
|
|
319
321
|
type GenreNodeActionBandProps = Omit<ComponentProps<typeof GenreActionBand>, "onPlayPause" | "isPlaying"> & {
|
|
320
322
|
genrePlaylist: PlayableGenrePlaylist;
|
|
321
323
|
playback: GenrePlaylistPlayback;
|
|
@@ -326,6 +328,7 @@ type GenreInfoPanelBodyProps<O extends CriteriaOverview> = {
|
|
|
326
328
|
toolbar?: ReactNode;
|
|
327
329
|
family: ReactNode;
|
|
328
330
|
genreUuid: GenreUuid;
|
|
331
|
+
catalogue?: GenreCatalogueCounts;
|
|
329
332
|
genrePlaylist: PlayableGenrePlaylist;
|
|
330
333
|
wikidataId?: string | null;
|
|
331
334
|
scope: Scope;
|
|
@@ -337,7 +340,7 @@ type GenreInfoPanelBodyProps<O extends CriteriaOverview> = {
|
|
|
337
340
|
};
|
|
338
341
|
/** The body of a genre's info panel: action band, then the genre's overview, family and tracks.
|
|
339
342
|
* Shared by the tree's panel and the standalone GenreDetailPanel. */
|
|
340
|
-
declare function GenreInfoPanelBody<O extends CriteriaOverview>({ toolbar, family, genreUuid, genrePlaylist, wikidataId, scope, getBackendBaseUrl, playback, band, extras, }: GenreInfoPanelBodyProps<O>): react.JSX.Element;
|
|
343
|
+
declare function GenreInfoPanelBody<O extends CriteriaOverview>({ toolbar, family, genreUuid, genrePlaylist, catalogue, wikidataId, scope, getBackendBaseUrl, playback, band, extras, }: GenreInfoPanelBodyProps<O>): react.JSX.Element;
|
|
341
344
|
|
|
342
345
|
type GenreDetailPanelProps<O extends CriteriaOverview> = {
|
|
343
346
|
genreUuid: GenreUuid;
|
package/dist/genre-tree/index.js
CHANGED