@behindthemusictree/app-kit-ui 30.0.0 → 32.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-2HE2HDFA.js → chunk-QGGVPIXY.js} +546 -618
- package/dist/chunk-QGGVPIXY.js.map +1 -0
- package/dist/genre-tree/index.cjs +547 -625
- package/dist/genre-tree/index.cjs.map +1 -1
- package/dist/genre-tree/index.d.ts +37 -40
- package/dist/genre-tree/index.js +3 -7
- package/dist/index.cjs +547 -625
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +3 -7
- package/package.json +6 -6
- package/dist/chunk-2HE2HDFA.js.map +0 -1
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode, ComponentProps } from 'react';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
-
import { GenreTreeProps, FocusChangeReason, GenreTreeNode, GenreTreeAction, GenreTreeViewMode, GenreTreeViewport,
|
|
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
6
|
import { TrackBase, CriteriaOverview, GenreUuid, CriteriaPlaylistMinimum, RenderArtistLink, RenderSongLink, CriteriaPlaylistSimple, GenrePlaylistUuid, ArtistSearchResult, CriteriaMinimum, SongSearchResult } from '@behindthemusictree/app-kit/genre-tree';
|
|
7
7
|
import { Scope } from '@behindthemusictree/app-kit/transport';
|
|
8
|
+
import { DetailPanel } from '@behindthemusictree/ui';
|
|
8
9
|
|
|
9
10
|
type GenrePlaylistTracksSlots = {
|
|
10
11
|
/** Rendered first in each row, e.g. a selection checkbox. `index` is the row's position in the loaded list. */
|
|
@@ -16,9 +17,9 @@ type GenrePlaylistTracksSlots = {
|
|
|
16
17
|
};
|
|
17
18
|
|
|
18
19
|
type GenreDetailSlots<O extends CriteriaOverview> = {
|
|
19
|
-
/** Replaces the default Summary section. */
|
|
20
|
+
/** Replaces the body of the default Summary section; the title and frame stay. */
|
|
20
21
|
renderSummary?: (overview: O) => ReactNode;
|
|
21
|
-
/** Replaces the default Essential section (e.g. "Essential songs"). */
|
|
22
|
+
/** Replaces the body of the default Essential section (e.g. "Essential songs"); the title and frame stay. */
|
|
22
23
|
renderEssentialTracks?: (overview: O) => ReactNode;
|
|
23
24
|
};
|
|
24
25
|
type GenreDetailExtrasProps<O extends CriteriaOverview> = GenreDetailSlots<O> & GenrePlaylistTracksSlots & {
|
|
@@ -40,8 +41,24 @@ type GenreDetailExtrasProps<O extends CriteriaOverview> = GenreDetailSlots<O> &
|
|
|
40
41
|
family: ReactNode;
|
|
41
42
|
};
|
|
42
43
|
|
|
43
|
-
/**
|
|
44
|
-
|
|
44
|
+
/** An artist or song detail the host renders in the shared DetailPanel in place of a genre's. */
|
|
45
|
+
interface OverlayPanel {
|
|
46
|
+
title: ReactNode;
|
|
47
|
+
content: ReactNode;
|
|
48
|
+
/** Second column, shown only while expanded. */
|
|
49
|
+
extraContent?: ReactNode;
|
|
50
|
+
expanded: boolean;
|
|
51
|
+
onExpandedChange: (expanded: boolean) => void;
|
|
52
|
+
onClose: () => void;
|
|
53
|
+
}
|
|
54
|
+
/** A host-supplied panel: expansion is optional because the host may not offer it. */
|
|
55
|
+
type HostOverlayPanel = Omit<OverlayPanel, "expanded" | "onExpandedChange"> & {
|
|
56
|
+
expanded?: boolean;
|
|
57
|
+
onExpandedChange?: (expanded: boolean) => void;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
/** 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
|
+
type HostPanelProps = Partial<Pick<GenreTreeProps, "obscuredInset" | "onNodeStyleResolverChange">>;
|
|
45
62
|
|
|
46
63
|
/** What a play button needs of a playlist; `criteria` is only read when playing one artist's songs in the genre. */
|
|
47
64
|
type PlayableGenrePlaylistInput = CriteriaPlaylistMinimum & {
|
|
@@ -197,7 +214,14 @@ type GenreTreeViewProps<O extends CriteriaOverview = CriteriaOverview> = {
|
|
|
197
214
|
renderSongLink?: RenderSongLink;
|
|
198
215
|
/** Resolves a selected genre, artist or song to a share URL using the host app's routes. */
|
|
199
216
|
getShareUrl?: GetGenreTreeShareUrl;
|
|
200
|
-
} & ArtistSearchProps & GenreDetailSlots<O> & GenrePlaylistTracksSlots &
|
|
217
|
+
} & ArtistSearchProps & GenreDetailSlots<O> & GenrePlaylistTracksSlots & GenreFocusProps & {
|
|
218
|
+
/** Appended to a selected genre's panel, e.g. destructive actions. */
|
|
219
|
+
renderDangerZone?: (node: GenreTreeNode) => ReactNode;
|
|
220
|
+
/** Controlled expanded state of the genre panel. Uncontrolled when omitted. */
|
|
221
|
+
expanded?: boolean;
|
|
222
|
+
onExpandedChange?: (expanded: boolean) => void;
|
|
223
|
+
/** A host panel rendered in the detail panel's slot; it takes precedence over the genre, song and artist panels. */
|
|
224
|
+
overlayPanel?: HostOverlayPanel;
|
|
201
225
|
/** Hides the info panel behind its edge tab; uncontrolled when omitted. Only applies with `placement="regions"`. */
|
|
202
226
|
collapsed?: boolean;
|
|
203
227
|
onCollapsedChange?: (collapsed: boolean) => void;
|
|
@@ -270,13 +294,12 @@ type GenreDetailPanelProps<O extends CriteriaOverview> = {
|
|
|
270
294
|
collapsed?: boolean;
|
|
271
295
|
expanded?: boolean;
|
|
272
296
|
onExpandedChange?: (expanded: boolean) => void;
|
|
297
|
+
/** Tab on the panel's inner edge, for hosts that hide and show the panel. */
|
|
298
|
+
edgeTab?: ComponentProps<typeof DetailPanel>["edgeTab"];
|
|
273
299
|
extras?: GenreInfoPanelBodyProps<O>["extras"];
|
|
274
300
|
};
|
|
275
301
|
/** A genre's detail panel driven by one uuid, with no tree behind it. The tree's own panel shares its body. */
|
|
276
|
-
declare function GenreDetailPanel<O extends CriteriaOverview>({ genreUuid, scope, getBackendBaseUrl, onClose, onSelectGenre, onZoomIn, shareUrl, shareTarget, collapsed, expanded, onExpandedChange, extras, }: GenreDetailPanelProps<O>): react.JSX.Element;
|
|
277
|
-
|
|
278
|
-
/** Gives the brand layout tokens a zero-width left column while no left detail panel is showing. */
|
|
279
|
-
declare function useLeftDetailPanelLayout(isPanelShown: boolean, enabled?: boolean): void;
|
|
302
|
+
declare function GenreDetailPanel<O extends CriteriaOverview>({ genreUuid, scope, getBackendBaseUrl, onClose, onSelectGenre, onZoomIn, shareUrl, shareTarget, collapsed, expanded, onExpandedChange, edgeTab, extras, }: GenreDetailPanelProps<O>): react.JSX.Element;
|
|
280
303
|
|
|
281
304
|
type GenrePlaylistTreePerRootProps<T extends TrackBase> = {
|
|
282
305
|
scope: Scope;
|
|
@@ -288,19 +311,12 @@ type GenrePlaylistTreePerRootProps<T extends TrackBase> = {
|
|
|
288
311
|
additionalActions?: (node: GenreTreeNode) => GenreTreeAction[];
|
|
289
312
|
onNodeClick?: (node: GenreTreeNode) => void;
|
|
290
313
|
onNodeHover?: (node: GenreTreeNode) => void;
|
|
291
|
-
renderInfoPanelBody?: (node: GenreTreeNode, sections: InfoPanelSections) => InfoPanelBody;
|
|
292
314
|
/** Overrides which node is shown highlighted, e.g. from a search selection. */
|
|
293
315
|
selectedNodeId?: string | null;
|
|
294
316
|
/** Fires when a user action changes the info panel's node, or `null` when it is closed. */
|
|
295
317
|
onSelectedNodeChange?: (node: GenreTreeNode | null) => void;
|
|
296
|
-
/** Hides the info panel's header close button. */
|
|
297
|
-
hideInfoPanelClose?: boolean;
|
|
298
|
-
/** Hides the info panel header's node name. */
|
|
299
|
-
hideInfoPanelTitle?: boolean;
|
|
300
318
|
/** When true, suppresses per-node create/rename affordances. Defaults to false. */
|
|
301
319
|
readOnly?: boolean;
|
|
302
|
-
/** When false, suppresses the hover toolbar on every node. Defaults to true. */
|
|
303
|
-
showToolbar?: boolean;
|
|
304
320
|
wheelZoom?: WheelZoomMode;
|
|
305
321
|
/** Mount-only seed for the pan/zoom, replacing the initial fit. */
|
|
306
322
|
defaultViewport?: GenreTreeViewport;
|
|
@@ -310,8 +326,8 @@ type GenrePlaylistTreePerRootProps<T extends TrackBase> = {
|
|
|
310
326
|
onViewportChange?: (viewport: GenreTreeViewport) => void;
|
|
311
327
|
/** What node play buttons play; defaults to each node's whole genre playlist. */
|
|
312
328
|
playback?: GenrePlaylistPlayback;
|
|
313
|
-
} &
|
|
314
|
-
declare function GenrePlaylistTreePerRoot<T extends TrackBase>({ scope, className, rootUuid, genrePlaylistTreePerRoot, handleGenreCreationAction, handleGenreRenameAction, additionalActions, onNodeClick, onNodeHover,
|
|
329
|
+
} & HostPanelProps;
|
|
330
|
+
declare function GenrePlaylistTreePerRoot<T extends TrackBase>({ scope, className, rootUuid, genrePlaylistTreePerRoot, handleGenreCreationAction, handleGenreRenameAction, additionalActions, onNodeClick, onNodeHover, selectedNodeId, onSelectedNodeChange, readOnly, wheelZoom, defaultViewport, viewportRestore, onViewportChange, playback, ...hostPanel }: GenrePlaylistTreePerRootProps<T>): react.JSX.Element;
|
|
315
331
|
|
|
316
332
|
type GenreSearchExtraGroup = {
|
|
317
333
|
key: string;
|
|
@@ -332,7 +348,7 @@ type GenreSearchProps<T extends CriteriaPlaylistSimple = CriteriaPlaylistSimple>
|
|
|
332
348
|
onSelect: (genrePlaylist: T) => void;
|
|
333
349
|
/** Name of the currently selected genre; fills the input whenever it changes. */
|
|
334
350
|
selectedName?: string | null;
|
|
335
|
-
/** When set, renders a "Previous" button left of the text
|
|
351
|
+
/** When set, renders a "Previous" button left of the text and makes room for it. */
|
|
336
352
|
onPrevious?: () => void;
|
|
337
353
|
/** Called by the clear button, after it empties the input. */
|
|
338
354
|
onClear?: () => void;
|
|
@@ -402,23 +418,4 @@ interface RatingProps {
|
|
|
402
418
|
}
|
|
403
419
|
declare function Rating({ rating, handleChange }: RatingProps): react.JSX.Element;
|
|
404
420
|
|
|
405
|
-
type
|
|
406
|
-
label: string;
|
|
407
|
-
onClick: () => void;
|
|
408
|
-
/** Reflected as `aria-expanded` on the button; omit when the button is not a disclosure. */
|
|
409
|
-
expanded?: boolean;
|
|
410
|
-
};
|
|
411
|
-
interface PanelEdgeTabProps {
|
|
412
|
-
/** Side of the screen the panel sits on; the tab hangs off the panel's inner edge. */
|
|
413
|
-
side: "left" | "right";
|
|
414
|
-
/** Button whose chevron points toward the screen edge. */
|
|
415
|
-
edge: PanelEdgeTabAction | null;
|
|
416
|
-
/** Button whose chevron points toward the center of the screen. */
|
|
417
|
-
center: PanelEdgeTabAction | null;
|
|
418
|
-
/** Id of the panel the buttons control, when the host can name it. */
|
|
419
|
-
controls?: string;
|
|
420
|
-
className?: string;
|
|
421
|
-
}
|
|
422
|
-
declare function PanelEdgeTab({ side, edge, center, controls, className }: PanelEdgeTabProps): react.JSX.Element | null;
|
|
423
|
-
|
|
424
|
-
export { type ArtistSearchProps, GenreDetailPanel, type GenreDetailPanelProps, type GenreDetailSlots, type GenreFocusProps, GenreInfoPanelBody, type GenreInfoPanelBodyProps, GenreNodeActionBand, type GenrePlaylistPlayback, type GenrePlaylistTracksSlots, GenrePlaylistTreePerRoot, type GenrePlaylistTreePerRootProps, GenreSearch, type GenreSearchExtraGroup, type GenreSearchProps, type GenreTreeShareTarget, GenreTreeView, type GenreTreeViewProps, type GetGenreTreeShareUrl, type InfoPanelCurationProps, PanelEdgeTab, type PanelEdgeTabAction, type PanelEdgeTabProps, type ParentChange, type PlayableGenrePlaylist, PlayerPanel, type PlayerPanelProps, Rating, type RatingProps, TrackItem, type TrackItemProps, TrackListSidebar, type TrackListSidebarProps, TrackPositionPlayPause, type TrackPositionPlayPauseProps, type UseGenrePlaylistPlaybackOptions, useGenrePlaylistPlayback, useLeftDetailPanelLayout };
|
|
421
|
+
export { type ArtistSearchProps, GenreDetailPanel, type GenreDetailPanelProps, type GenreDetailSlots, type GenreFocusProps, GenreInfoPanelBody, type GenreInfoPanelBodyProps, GenreNodeActionBand, type GenrePlaylistPlayback, type GenrePlaylistTracksSlots, GenrePlaylistTreePerRoot, type GenrePlaylistTreePerRootProps, GenreSearch, type GenreSearchExtraGroup, type GenreSearchProps, type GenreTreeShareTarget, GenreTreeView, type GenreTreeViewProps, type GetGenreTreeShareUrl, type ParentChange, type PlayableGenrePlaylist, PlayerPanel, type PlayerPanelProps, Rating, type RatingProps, TrackItem, type TrackItemProps, TrackListSidebar, type TrackListSidebarProps, TrackPositionPlayPause, type TrackPositionPlayPauseProps, type UseGenrePlaylistPlaybackOptions, useGenrePlaylistPlayback };
|
package/dist/genre-tree/index.js
CHANGED
|
@@ -9,15 +9,13 @@ import {
|
|
|
9
9
|
GenreTreeView,
|
|
10
10
|
GenreTreeViewSkeleton,
|
|
11
11
|
GenreTreeWheelSkeleton,
|
|
12
|
-
PanelEdgeTab,
|
|
13
12
|
PlayerPanel,
|
|
14
13
|
Rating,
|
|
15
14
|
TrackItem,
|
|
16
15
|
TrackListSidebar,
|
|
17
16
|
TrackPositionPlayPause,
|
|
18
|
-
useGenrePlaylistPlayback
|
|
19
|
-
|
|
20
|
-
} from "../chunk-2HE2HDFA.js";
|
|
17
|
+
useGenrePlaylistPlayback
|
|
18
|
+
} from "../chunk-QGGVPIXY.js";
|
|
21
19
|
import "../chunk-DKQQLLMY.js";
|
|
22
20
|
export {
|
|
23
21
|
GenreDetailPanel,
|
|
@@ -30,13 +28,11 @@ export {
|
|
|
30
28
|
GenreTreeView,
|
|
31
29
|
GenreTreeViewSkeleton,
|
|
32
30
|
GenreTreeWheelSkeleton,
|
|
33
|
-
PanelEdgeTab,
|
|
34
31
|
PlayerPanel,
|
|
35
32
|
Rating,
|
|
36
33
|
TrackItem,
|
|
37
34
|
TrackListSidebar,
|
|
38
35
|
TrackPositionPlayPause,
|
|
39
|
-
useGenrePlaylistPlayback
|
|
40
|
-
useLeftDetailPanelLayout
|
|
36
|
+
useGenrePlaylistPlayback
|
|
41
37
|
};
|
|
42
38
|
//# sourceMappingURL=index.js.map
|