@behindthemusictree/app-kit-ui 36.0.0 → 37.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-RTXLUHJY.js → chunk-FTYMRCJS.js} +21 -13
- package/dist/chunk-FTYMRCJS.js.map +1 -0
- package/dist/genre-tree/index.cjs +20 -12
- package/dist/genre-tree/index.cjs.map +1 -1
- package/dist/genre-tree/index.d.ts +9 -4
- package/dist/genre-tree/index.js +1 -1
- package/dist/index.cjs +20 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +5 -5
- package/dist/chunk-RTXLUHJY.js.map +0 -1
|
@@ -722,6 +722,7 @@ function SearchBox({
|
|
|
722
722
|
groups,
|
|
723
723
|
onPicked,
|
|
724
724
|
onClear,
|
|
725
|
+
clearLabel,
|
|
725
726
|
leading,
|
|
726
727
|
className: className2,
|
|
727
728
|
onFocus
|
|
@@ -753,6 +754,7 @@ function SearchBox({
|
|
|
753
754
|
status,
|
|
754
755
|
loading,
|
|
755
756
|
onClear,
|
|
757
|
+
clearLabel,
|
|
756
758
|
leading,
|
|
757
759
|
inputClassName: "focus-visible:ring-0"
|
|
758
760
|
}
|
|
@@ -848,6 +850,8 @@ function GenreSearch({
|
|
|
848
850
|
onSelect,
|
|
849
851
|
selectedName = null,
|
|
850
852
|
onClear,
|
|
853
|
+
showClear,
|
|
854
|
+
clearLabel,
|
|
851
855
|
onPrevious,
|
|
852
856
|
placeholder,
|
|
853
857
|
onQueryChange,
|
|
@@ -895,7 +899,8 @@ function GenreSearch({
|
|
|
895
899
|
if (groupKey !== "genres") setQuery("");
|
|
896
900
|
onQueryChange?.("");
|
|
897
901
|
},
|
|
898
|
-
|
|
902
|
+
clearLabel,
|
|
903
|
+
onClear: showClear ?? canClear ? () => {
|
|
899
904
|
clear();
|
|
900
905
|
onQueryChange?.("");
|
|
901
906
|
} : void 0,
|
|
@@ -1759,10 +1764,12 @@ function useGenreDetailContent({
|
|
|
1759
1764
|
};
|
|
1760
1765
|
}, [detail, scope]);
|
|
1761
1766
|
if (isError) return {
|
|
1767
|
+
name: null,
|
|
1762
1768
|
title: "Genre unavailable",
|
|
1763
1769
|
content: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { role: "alert", className: "p-4 text-sm text-[var(--color-text)]", children: "This genre could not be loaded." })
|
|
1764
1770
|
};
|
|
1765
1771
|
if (isPending || !detail || !view) return {
|
|
1772
|
+
name: null,
|
|
1766
1773
|
title: "Loading genre\u2026",
|
|
1767
1774
|
content: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex flex-col gap-3 p-4", "aria-busy": "true", "data-testid": "genre-detail-panel-skeleton", children: [
|
|
1768
1775
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_ui7.Skeleton, { className: "h-6 w-2/3" }),
|
|
@@ -1784,6 +1791,7 @@ function useGenreDetailContent({
|
|
|
1784
1791
|
);
|
|
1785
1792
|
const ancestors = /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_genre_tree_view4.GenreNodeAncestors, { ancestorNodes: view.ancestorNodes, onSelectNode: selectGenre });
|
|
1786
1793
|
return {
|
|
1794
|
+
name: detail.name,
|
|
1787
1795
|
title: detail.name,
|
|
1788
1796
|
headerAccent: { background: view.fill, color: import_genre_tree_view4.ACCENT_TEXT_COLOR },
|
|
1789
1797
|
aside: expanded ? ancestors : void 0,
|
|
@@ -1825,7 +1833,7 @@ function GenreDetailPanel({
|
|
|
1825
1833
|
onExpandedChange,
|
|
1826
1834
|
edgeTab,
|
|
1827
1835
|
extras,
|
|
1828
|
-
|
|
1836
|
+
titleInSearch
|
|
1829
1837
|
}) {
|
|
1830
1838
|
const panel = useGenreDetailContent({
|
|
1831
1839
|
genreUuid,
|
|
@@ -1848,7 +1856,7 @@ function GenreDetailPanel({
|
|
|
1848
1856
|
onExpandedChange,
|
|
1849
1857
|
edgeTab,
|
|
1850
1858
|
aside: panel.aside,
|
|
1851
|
-
|
|
1859
|
+
titleInSearch,
|
|
1852
1860
|
headerActions: onExpandedChange ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_ui7.IconButton, { "aria-label": expanded ? "Shrink panel" : "Extend panel", onClick: () => onExpandedChange(!expanded), children: expanded ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react8.Minimize2, { "aria-hidden": "true", className: "h-4 w-4" }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react8.Maximize2, { "aria-hidden": "true", className: "h-4 w-4" }) }) : void 0,
|
|
1853
1861
|
children: panel.content
|
|
1854
1862
|
}
|
|
@@ -2824,7 +2832,6 @@ function GenreTreeView({
|
|
|
2824
2832
|
if (node !== null && songUuid !== null) changeSong(null);
|
|
2825
2833
|
selectNode(node);
|
|
2826
2834
|
};
|
|
2827
|
-
const handleGenreSearchClear = clearSelection;
|
|
2828
2835
|
const handleGenreSearchSelect = (genrePlaylist2) => {
|
|
2829
2836
|
reopenPanel();
|
|
2830
2837
|
if (songUuid !== null) changeSong(null);
|
|
@@ -2907,7 +2914,7 @@ function GenreTreeView({
|
|
|
2907
2914
|
expanded: overlayPanel.expanded ?? false,
|
|
2908
2915
|
onExpandedChange: overlayPanel.onExpandedChange,
|
|
2909
2916
|
onClose: overlayPanel.onClose,
|
|
2910
|
-
|
|
2917
|
+
titleInSearch: false
|
|
2911
2918
|
};
|
|
2912
2919
|
} else if (selectedGenreUuid) {
|
|
2913
2920
|
activePanel = {
|
|
@@ -2917,7 +2924,7 @@ function GenreTreeView({
|
|
|
2917
2924
|
expanded: isExpanded,
|
|
2918
2925
|
onExpandedChange: changeExpanded,
|
|
2919
2926
|
onClose: clearSelection,
|
|
2920
|
-
|
|
2927
|
+
titleInSearch: true,
|
|
2921
2928
|
headerAccent: relations ? { background: relations.fill, color: relations.textColor } : genreContent.headerAccent
|
|
2922
2929
|
};
|
|
2923
2930
|
} else if (builtInPanel) {
|
|
@@ -2928,7 +2935,7 @@ function GenreTreeView({
|
|
|
2928
2935
|
expanded: builtInPanel.expanded,
|
|
2929
2936
|
onExpandedChange: builtInPanel.onExpandedChange,
|
|
2930
2937
|
onClose: builtInPanel.onClose,
|
|
2931
|
-
|
|
2938
|
+
titleInSearch: true
|
|
2932
2939
|
};
|
|
2933
2940
|
}
|
|
2934
2941
|
const isPanelShown = activePanel !== null && (selectedGenreUuid !== null || isTreeReady);
|
|
@@ -2996,8 +3003,10 @@ function GenreTreeView({
|
|
|
2996
3003
|
if (songUuid) changeSong(null);
|
|
2997
3004
|
selectGenre(uuid);
|
|
2998
3005
|
},
|
|
2999
|
-
selectedName:
|
|
3000
|
-
onClear:
|
|
3006
|
+
selectedName: selectedGenreUuid ? genreContent.name : typeof builtInPanel?.title === "string" ? builtInPanel.title : null,
|
|
3007
|
+
onClear: activePanel?.onClose,
|
|
3008
|
+
showClear: activePanel?.titleInSearch ?? false,
|
|
3009
|
+
clearLabel: "Close panel",
|
|
3001
3010
|
onPrevious: handlePrevious,
|
|
3002
3011
|
onQueryChange: onSearchQueryChange,
|
|
3003
3012
|
onFocus: onSearchFocus,
|
|
@@ -3187,8 +3196,7 @@ function GenreTreeView({
|
|
|
3187
3196
|
ref: panelRef,
|
|
3188
3197
|
side: "left",
|
|
3189
3198
|
title: activePanel?.title ?? "",
|
|
3190
|
-
|
|
3191
|
-
hideClose: activePanel?.compact,
|
|
3199
|
+
titleInSearch: activePanel?.titleInSearch,
|
|
3192
3200
|
headerAccent: activePanel?.headerAccent,
|
|
3193
3201
|
headerActions: expandButton,
|
|
3194
3202
|
onClose: activePanel?.onClose ?? noop,
|
|
@@ -3197,7 +3205,7 @@ function GenreTreeView({
|
|
|
3197
3205
|
onExpandedChange: activePanel?.onExpandedChange,
|
|
3198
3206
|
aside: activePanel?.aside,
|
|
3199
3207
|
edgeTab: detailTab,
|
|
3200
|
-
headerClassName: "pt-[calc(var(--layout-search-h)+var(--layout-panel-inset)+0.5rem)]",
|
|
3208
|
+
headerClassName: activePanel?.titleInSearch ? void 0 : "pt-[calc(var(--layout-search-h)+var(--layout-panel-inset)+0.5rem)]",
|
|
3201
3209
|
children: activePanel?.aside && !activePanel.expanded ? /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
|
|
3202
3210
|
activePanel.content,
|
|
3203
3211
|
activePanel.aside
|