@behindthemusictree/app-kit-ui 41.0.0 → 42.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.
@@ -2074,11 +2074,37 @@ function formatYears(beginYear, endYear, ended) {
2074
2074
  // src/genre-tree/artist/ArtistHeader.tsx
2075
2075
  var import_jsx_runtime35 = require("react/jsx-runtime");
2076
2076
  var countryNames = new Intl.DisplayNames(["en"], { type: "region" });
2077
- function ArtistHeader({ artist }) {
2077
+ function originLabel(artist, origin) {
2078
+ if (origin.source === "area") return "From";
2079
+ if (artist.type === "person") return "Born in";
2080
+ if (artist.type === "group") return "Formed in";
2081
+ return "From";
2082
+ }
2083
+ function OriginValue({
2084
+ origin,
2085
+ country,
2086
+ renderPlaceLink
2087
+ }) {
2088
+ const place = renderPlaceLink && origin.regionId !== null ? renderPlaceLink({ ...origin, regionId: origin.regionId }) : origin.name;
2089
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
2090
+ place,
2091
+ country && origin.kind !== "country" && `, ${country}`
2092
+ ] });
2093
+ }
2094
+ function ArtistHeader({
2095
+ artist,
2096
+ renderPlaceLink
2097
+ }) {
2078
2098
  const fields = [];
2079
2099
  if (artist.type) fields.push({ label: "Type", value: artist.type.charAt(0).toUpperCase() + artist.type.slice(1) });
2080
- const country = artist.country && countryNames.of(artist.country);
2081
- if (country) fields.push({ label: "Country", value: country });
2100
+ const country = artist.country ? countryNames.of(artist.country) : void 0;
2101
+ if (artist.origin) {
2102
+ fields.push({
2103
+ label: originLabel(artist, artist.origin),
2104
+ value: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(OriginValue, { origin: artist.origin, country, renderPlaceLink })
2105
+ });
2106
+ }
2107
+ if (country && !artist.origin) fields.push({ label: "Country", value: country });
2082
2108
  const years = formatYears(artist.beginYear, artist.endYear, artist.ended);
2083
2109
  if (years) fields.push({ label: "Active", value: years });
2084
2110
  const links = artistLinks(artist);
@@ -2367,6 +2393,7 @@ function useArtistPanel({
2367
2393
  getShareUrl,
2368
2394
  renderArtistLink,
2369
2395
  renderSongLink,
2396
+ renderPlaceLink,
2370
2397
  expanded,
2371
2398
  onExpandedChange,
2372
2399
  onClose
@@ -2417,7 +2444,7 @@ function useArtistPanel({
2417
2444
  }
2418
2445
  ),
2419
2446
  artist.image && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(ArtistPhoto, { image: artist.image, name: artist.name }),
2420
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(ArtistHeader, { artist }),
2447
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(ArtistHeader, { artist, renderPlaceLink }),
2421
2448
  /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(ArtistMembers, { title: "Members", memberships: artist.members, renderArtistLink }),
2422
2449
  /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(ArtistMembers, { title: "Member of", memberships: artist.memberOf, renderArtistLink }),
2423
2450
  artist.tracksCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
@@ -2625,6 +2652,7 @@ function useEntityPanel({
2625
2652
  getShareUrl,
2626
2653
  renderArtistLink,
2627
2654
  renderSongLink,
2655
+ renderPlaceLink,
2628
2656
  song,
2629
2657
  artist,
2630
2658
  ...navigation
@@ -2643,7 +2671,8 @@ function useEntityPanel({
2643
2671
  getBackendBaseUrl: getArtistBackendBaseUrl ?? getBackendBaseUrl,
2644
2672
  getShareUrl,
2645
2673
  renderArtistLink,
2646
- renderSongLink
2674
+ renderSongLink,
2675
+ renderPlaceLink
2647
2676
  });
2648
2677
  return songPanel ?? artistPanel;
2649
2678
  }
@@ -2720,6 +2749,7 @@ function GenreTreeView({
2720
2749
  songSearch = true,
2721
2750
  onSongSelect,
2722
2751
  renderSongLink,
2752
+ renderPlaceLink,
2723
2753
  renderSummary,
2724
2754
  renderEssentialTracks,
2725
2755
  renderSongLeading,
@@ -2849,6 +2879,7 @@ function GenreTreeView({
2849
2879
  getShareUrl: getShareUrlRef.current,
2850
2880
  renderArtistLink: resolvedRenderArtistLink,
2851
2881
  renderSongLink: resolvedRenderSongLink,
2882
+ renderPlaceLink,
2852
2883
  song: {
2853
2884
  uuid: songUuid,
2854
2885
  expanded: controlledSongExpanded ?? (songUuid !== null && expandedSongUuid === songUuid),
@@ -3754,6 +3785,7 @@ function EntityDetailPanel({
3754
3785
  onArtistUuidChange,
3755
3786
  renderArtistLink,
3756
3787
  renderSongLink,
3788
+ renderPlaceLink,
3757
3789
  collapsed,
3758
3790
  edgeTab,
3759
3791
  ...navigation
@@ -3765,6 +3797,7 @@ function EntityDetailPanel({
3765
3797
  getBackendBaseUrl,
3766
3798
  getArtistBackendBaseUrl,
3767
3799
  getShareUrl,
3800
+ renderPlaceLink,
3768
3801
  renderArtistLink: renderArtistLink ?? ((artist) => artist.isSpecialPurpose ? artist.name : /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("button", { type: "button", onClick: () => onArtistUuidChange(artist.uuid), className: "hover:underline", children: artist.name })),
3769
3802
  renderSongLink: renderSongLink ?? ((song) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("button", { type: "button", onClick: () => onSongUuidChange(song.uuid), className: "hover:underline", children: song.title })),
3770
3803
  song: {