@sarimarcus/content-sites-ui 0.51.0 → 0.51.1
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/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
All packages in the platform release in lockstep; entries are per release version.
|
|
4
4
|
|
|
5
|
+
## 0.51.1 (2026-10-27)
|
|
6
|
+
|
|
7
|
+
- `ui`: `PeopleBand` throws a clear error when given a `pool` without `toLink`; `buildEraListing` takes its lastmod from core `maxDate`; the person page's era timeline orders people with `groupByEra`. No rendered change on Córdoba or Granada (proof.mjs: byte-identical, no `--allow`) (SLA-3536).
|
|
8
|
+
|
|
5
9
|
## 0.51.0 (2026-10-27)
|
|
6
10
|
|
|
7
11
|
- `core`: `createPeople({load, url, portraits})` (`toPersonLink`, `resolvePeople`, `personPortrait`, `personHref`) and `roleLabel`; `dossiersFromHubs(hubMap, ...keys)` in `eras`; `pagedTopicMeta` and `pagedEraMeta` (required `labelNamesCity`) in `text`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sarimarcus/content-sites-ui",
|
|
3
|
-
"version": "0.51.
|
|
3
|
+
"version": "0.51.1",
|
|
4
4
|
"description": "Universal Astro UI components, layout shell and design tokens shared by the content sites.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -50,6 +50,6 @@
|
|
|
50
50
|
"@lucide/astro": "^1.23.0",
|
|
51
51
|
"astro": "^7.0.6",
|
|
52
52
|
"tailwindcss": "^4.1.18",
|
|
53
|
-
"@sarimarcus/content-sites-core": "0.51.
|
|
53
|
+
"@sarimarcus/content-sites-core": "0.51.1"
|
|
54
54
|
}
|
|
55
55
|
}
|
|
@@ -46,6 +46,7 @@ let people: readonly Person[];
|
|
|
46
46
|
if (given) {
|
|
47
47
|
people = given.slice(0, max);
|
|
48
48
|
} else {
|
|
49
|
+
if (!toLink) throw new Error('PeopleBand: a pool needs toLink');
|
|
49
50
|
const pool = allPeople.filter(
|
|
50
51
|
(p) => eras.includes(p.data.era as string) && (!roles || p.data.roles.some((r) => roles.includes(r))),
|
|
51
52
|
);
|
|
@@ -56,7 +57,7 @@ if (given) {
|
|
|
56
57
|
for (const list of lists) if (i < list.length && picked.length < max) picked.push(list[i]);
|
|
57
58
|
}
|
|
58
59
|
const order = new Map(lists.flat().map((p, i) => [p, i]));
|
|
59
|
-
people = picked.sort((a, b) => order.get(a)! - order.get(b)!).map((p) => toLink
|
|
60
|
+
people = picked.sort((a, b) => order.get(a)! - order.get(b)!).map((p) => toLink(p.data));
|
|
60
61
|
}
|
|
61
62
|
const headingId = `people-band-${slugify(heading)}`;
|
|
62
63
|
---
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { EraDefinition } from '@sarimarcus/content-sites-core/eras';
|
|
2
|
+
import { maxDate } from '@sarimarcus/content-sites-core/dates';
|
|
2
3
|
import { toAbsoluteSiteUrl, url } from '@sarimarcus/content-sites-core/url';
|
|
3
4
|
import { LABELS } from '../internal/labels';
|
|
4
5
|
|
|
@@ -36,10 +37,7 @@ export function buildEraListing(input: EraListingInput) {
|
|
|
36
37
|
const siteUrl = rawSiteUrl.replace(/\/$/, '');
|
|
37
38
|
const pagePath = (n: number) => (n <= 1 ? hubPath : `${hubPath}/page/${n}`);
|
|
38
39
|
const abs = (path: string) => toAbsoluteSiteUrl(url(path, basePath), siteUrl, basePath);
|
|
39
|
-
const lastmod = eraArticles
|
|
40
|
-
.map((a) => a.data.dateModified || a.data.datePublished || '')
|
|
41
|
-
.sort()
|
|
42
|
-
.at(-1);
|
|
40
|
+
const lastmod = maxDate(...eraArticles.map((a) => a.data.dateModified || a.data.datePublished || ''));
|
|
43
41
|
const heading = first ? copy.h1 : `${copy.h1} (${L.pageLabel(page)})`;
|
|
44
42
|
const items = pageArticles.map((a) => ({
|
|
45
43
|
name: a.data.title,
|
|
@@ -3,7 +3,7 @@ import { formatYearRange } from '@sarimarcus/content-sites-core/eras';
|
|
|
3
3
|
import { buildPersonBacklinks, formatLifeDates, type PersonBacklink } from '@sarimarcus/content-sites-core/people';
|
|
4
4
|
import type { RelatedItem } from '../composed/related';
|
|
5
5
|
import { LABELS } from '../internal/labels';
|
|
6
|
-
import type
|
|
6
|
+
import { groupByEra, type TimelineItem } from './chronology';
|
|
7
7
|
|
|
8
8
|
type PersonType = string;
|
|
9
9
|
interface Linked {
|
|
@@ -115,9 +115,7 @@ export function buildPersonModel<A extends { data: { slug: string; dateModified?
|
|
|
115
115
|
const card = toCardItem('monument', m as never);
|
|
116
116
|
return { title: card.title, href: card.href, kind: card.eyebrow ?? monumentKind, yearLabel: formatYearRange(m.data.yearStart, m.data.yearEnd), description: card.description, image: card.image };
|
|
117
117
|
}),
|
|
118
|
-
...people
|
|
119
|
-
.filter((p) => p.data.era === era.id && p.data.slug !== person.slug)
|
|
120
|
-
.sort((a, b) => byYear(a.data.birthYear ?? a.data.deathYear, b.data.birthYear ?? b.data.deathYear))
|
|
118
|
+
...(groupByEra(people.filter((p) => p.data.slug !== person.slug), (p) => p.data.era, (p) => p.data.birthYear ?? p.data.deathYear)[era.id] ?? [])
|
|
121
119
|
.slice(0, timelineLimit)
|
|
122
120
|
.map((p) => ({ title: p.data.name, href: personHref(p.data.slug), kind: personKind, yearLabel: formatLifeDates(p.data), description: p.data.description, image: personPortrait(p.data.slug) })),
|
|
123
121
|
]
|