@behindthemusictree/app-kit-ui 34.0.0 → 34.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-A7OWCEIK.js → chunk-JP7PID7L.js} +333 -303
- package/dist/chunk-JP7PID7L.js.map +1 -0
- package/dist/genre-tree/index.cjs +444 -414
- package/dist/genre-tree/index.cjs.map +1 -1
- package/dist/genre-tree/index.d.ts +32 -24
- package/dist/genre-tree/index.js +1 -1
- package/dist/index.cjs +439 -409
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +3 -3
- package/dist/chunk-A7OWCEIK.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { ReactNode, ComponentProps } from 'react';
|
|
2
|
+
import { ReactNode, ComponentType, 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';
|
|
@@ -153,6 +153,33 @@ type UseGenreRemoteSearchGroupOptions = UseGenreRemoteSearchOptions & {
|
|
|
153
153
|
/** Genres from the API's ranked `genres/search/`, rendered with the umbrella tag and the tree they live in. */
|
|
154
154
|
declare function useGenreRemoteSearchGroup(getBaseUrl: () => string, text: string, onSelect: (genre: GenreSearchResult) => void, { key, label, filter, describe, ...options }?: UseGenreRemoteSearchGroupOptions): SearchGroup;
|
|
155
155
|
|
|
156
|
+
/** @deprecated Use `SearchGroup`. */
|
|
157
|
+
type GenreSearchExtraGroup = SearchGroup;
|
|
158
|
+
type GenreSearchProps<T extends CriteriaPlaylistSimple = CriteriaPlaylistSimple> = {
|
|
159
|
+
genrePlaylists: T[];
|
|
160
|
+
onSelect: (genrePlaylist: T) => void;
|
|
161
|
+
/** Name of the currently selected genre; fills the input whenever it changes. */
|
|
162
|
+
selectedName?: string | null;
|
|
163
|
+
/** When set, renders a "Previous" button left of the text and makes room for it. */
|
|
164
|
+
onPrevious?: () => void;
|
|
165
|
+
/** Called by the clear button, after it empties the input. */
|
|
166
|
+
onClear?: () => void;
|
|
167
|
+
placeholder?: string;
|
|
168
|
+
/** Called with what the user types, and with "" on clear or pick; never when `selectedName` refills the input. */
|
|
169
|
+
onQueryChange?: (query: string) => void;
|
|
170
|
+
/** Further result groups (places, artists, songs) the host resolves from `onQueryChange`. */
|
|
171
|
+
extraGroups?: SearchGroup[];
|
|
172
|
+
/** Called when the input gains focus. */
|
|
173
|
+
onFocus?: () => void;
|
|
174
|
+
};
|
|
175
|
+
declare function GenreSearch<T extends CriteriaPlaylistSimple = CriteriaPlaylistSimple>({ genrePlaylists, onSelect, selectedName, onClear, onPrevious, placeholder, onQueryChange, extraGroups, onFocus, }: GenreSearchProps<T>): react.JSX.Element;
|
|
176
|
+
|
|
177
|
+
interface GenreSearchGroupsProps {
|
|
178
|
+
query: string;
|
|
179
|
+
focused: boolean;
|
|
180
|
+
children: (groups: SearchGroup[]) => ReactNode;
|
|
181
|
+
}
|
|
182
|
+
|
|
156
183
|
type ParentChange = {
|
|
157
184
|
genre: GenreUuid;
|
|
158
185
|
from: GenreUuid | null;
|
|
@@ -225,6 +252,8 @@ type GenreTreeViewProps<O extends CriteriaOverview = CriteriaOverview> = {
|
|
|
225
252
|
readOnly?: boolean;
|
|
226
253
|
/** Further result groups (e.g. places) shown in the search box next to genres, artists and songs. */
|
|
227
254
|
extraSearchGroups?: SearchGroup[];
|
|
255
|
+
/** Host search hooks run inside this subtree, so typing does not rerender the tree page. */
|
|
256
|
+
SearchGroups?: ComponentType<GenreSearchGroupsProps>;
|
|
228
257
|
/** Fires with the typed search text (empty when cleared), so a host can drive its own `extraSearchGroups`. */
|
|
229
258
|
onSearchQueryChange?: (text: string) => void;
|
|
230
259
|
/** Fires when the search box gains focus, e.g. to load data for `extraSearchGroups` lazily. */
|
|
@@ -288,7 +317,7 @@ type GenreTreeViewProps<O extends CriteriaOverview = CriteriaOverview> = {
|
|
|
288
317
|
collapsed?: boolean;
|
|
289
318
|
onCollapsedChange?: (collapsed: boolean) => void;
|
|
290
319
|
};
|
|
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;
|
|
320
|
+
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, SearchGroups, 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;
|
|
292
321
|
|
|
293
322
|
type GenreActionBandProps = {
|
|
294
323
|
node: GenreTreeNode;
|
|
@@ -392,27 +421,6 @@ type GenrePlaylistTreePerRootProps<T extends TrackBase> = {
|
|
|
392
421
|
} & HostPanelProps;
|
|
393
422
|
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;
|
|
394
423
|
|
|
395
|
-
/** @deprecated Use `SearchGroup`. */
|
|
396
|
-
type GenreSearchExtraGroup = SearchGroup;
|
|
397
|
-
type GenreSearchProps<T extends CriteriaPlaylistSimple = CriteriaPlaylistSimple> = {
|
|
398
|
-
genrePlaylists: T[];
|
|
399
|
-
onSelect: (genrePlaylist: T) => void;
|
|
400
|
-
/** Name of the currently selected genre; fills the input whenever it changes. */
|
|
401
|
-
selectedName?: string | null;
|
|
402
|
-
/** When set, renders a "Previous" button left of the text and makes room for it. */
|
|
403
|
-
onPrevious?: () => void;
|
|
404
|
-
/** Called by the clear button, after it empties the input. */
|
|
405
|
-
onClear?: () => void;
|
|
406
|
-
placeholder?: string;
|
|
407
|
-
/** Called with what the user types, and with "" on clear or pick; never when `selectedName` refills the input. */
|
|
408
|
-
onQueryChange?: (query: string) => void;
|
|
409
|
-
/** Further result groups (places, artists, songs) the host resolves from `onQueryChange`. */
|
|
410
|
-
extraGroups?: SearchGroup[];
|
|
411
|
-
/** Called when the input gains focus. */
|
|
412
|
-
onFocus?: () => void;
|
|
413
|
-
};
|
|
414
|
-
declare function GenreSearch<T extends CriteriaPlaylistSimple = CriteriaPlaylistSimple>({ genrePlaylists, onSelect, selectedName, onClear, onPrevious, placeholder, onQueryChange, extraGroups, onFocus, }: GenreSearchProps<T>): react.JSX.Element;
|
|
415
|
-
|
|
416
424
|
interface TrackListSidebarProps<T extends TrackBase> {
|
|
417
425
|
className?: string;
|
|
418
426
|
renderDuration?: (track: T) => ReactNode;
|
|
@@ -471,4 +479,4 @@ interface RatingProps {
|
|
|
471
479
|
}
|
|
472
480
|
declare function Rating({ rating, handleChange }: RatingProps): react.JSX.Element;
|
|
473
481
|
|
|
474
|
-
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, SEARCH_FAILED_STATUS, SearchBox, type SearchBoxProps, type SearchGroup, type SearchGroupItem, TrackItem, type TrackItemProps, TrackListSidebar, type TrackListSidebarProps, TrackPositionPlayPause, type TrackPositionPlayPauseProps, type UseGenrePlaylistPlaybackOptions, type UseGenreRemoteSearchGroupOptions, searchStatus, useArtistSearchGroup, useGenrePlaylistPlayback, useGenreRemoteSearchGroup, useSongSearchGroup };
|
|
482
|
+
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 GenreSearchGroupsProps, type GenreSearchProps, type GenreTreeShareTarget, GenreTreeView, type GenreTreeViewProps, type GetGenreTreeShareUrl, type ParentChange, type PlayableGenrePlaylist, PlayerPanel, type PlayerPanelProps, Rating, type RatingProps, SEARCH_FAILED_STATUS, SearchBox, type SearchBoxProps, type SearchGroup, type SearchGroupItem, TrackItem, type TrackItemProps, TrackListSidebar, type TrackListSidebarProps, TrackPositionPlayPause, type TrackPositionPlayPauseProps, type UseGenrePlaylistPlaybackOptions, type UseGenreRemoteSearchGroupOptions, searchStatus, useArtistSearchGroup, useGenrePlaylistPlayback, useGenreRemoteSearchGroup, useSongSearchGroup };
|
package/dist/genre-tree/index.js
CHANGED