Block library: item headings follow the section; the leading block's first image is the LCP image

Found by ipal-doctor live-seo on the reference archive pages (entry list under a
page header without a picture): cards jumped h1 → h3, and the first card image
was lazy.

- itemHeadingLevel: items one below the section heading (h3 under h2, h2 under the
  page h1, h2 when the block shows no heading); createBlockRegistry({ itemHeadings })
  fixes a level per block. featureGrid, entryList, pricing, steps, team.
- blockPosition / blockHasImage (root): createPageRoute and the 404 view pass
  firstImage next to isFirst; leadsWithImage marks the first image of the leading
  block eager + fetchPriority high (hero, textMedia, featureGrid, gallery, team,
  entryList); priorityImage: false turns it off.
- reference/ipal-doctor.json: the two live-seo silences removed; reference skills
  and docs/agent/reference-site/INDEX.md refreshed.
- bin/ipal-blocks.mjs executable like the other bins.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-10-29 16:38:04 +01:00
co-authored by Claude Opus 5.5
parent dd11bc8146
commit 6f56ef4205
27 changed files with 206 additions and 53 deletions
@@ -4,6 +4,7 @@ import type { BaseBlockData, LinkData, MediaValue } from '../../data.js'
import { MEDIA_SIZES } from '../../../media/mediaProps.js'
import { Buttons, headingId } from '../../ui/Buttons.js'
import { cx, parts } from '../../ui/cx.js'
import { itemHeadingLevel, leadsWithImage } from '../../ui/levels.js'
import { TitleLink } from '../../ui/TitleLink.js'
export type TeamMember = { bio?: null | string; heading: string; id?: null | string; link?: LinkData; media?: MediaValue; text?: null | string }
@@ -26,17 +27,19 @@ export function TeamBlock(props: LibraryBlockProps<TeamBlockData>) {
const c = parts(TEAM_PARTS, classNames)
const id = headingId(props)
const list = variant === 'list'
const H = itemHeadingLevel('team', props)
const lead = leadsWithImage(props)
return (
<ui.Section block={props.blockType} labelledBy={id} settings={settings}>
<ui.SectionHeader as={isFirst ? 'h1' : 'h2'} header={header} id={id} />
<ul className={list ? c.list : c.grid}>
{items.map((m, i) => (
<li className={cx('flex flex-col gap-3', list && c.listItem)} key={m.id ?? i}>
<ui.Media className={c.photo} resource={m.media} sizes={list ? '10rem' : MEDIA_SIZES.third} />
<ui.Media className={c.photo} priority={lead && i === 0} resource={m.media} sizes={list ? '10rem' : MEDIA_SIZES.third} />
<div className="flex flex-col gap-1">
<h3 className={c.name}><TitleLink link={m.link} Link={ctx.Link} locale={locale} resolve={ctx.content.resolveLink} stretch={false}>
<H className={c.name}><TitleLink link={m.link} Link={ctx.Link} locale={locale} resolve={ctx.content.resolveLink} stretch={false}>
{m.heading}
</TitleLink></h3>
</TitleLink></H>
{m.text ? <p className={c.role}>{m.text}</p> : null}
{m.bio ? <p className={c.bio}>{m.bio}</p> : null}
</div>