Block library: fixes from the first visual test on the reference site
- CMSLink: a link that wraps content (a logo, a card) and leads nowhere keeps the
content — an empty link group ({ type: 'internal' }) no longer hides logos
- entryList: field `collection` → `entryCollection` (Mongoose reserves
`collection`; unreleased, snapshot updated) + a test against reserved names
- post template starts with a page hero holding the title (the page's h1)
- legal and cookie policy templates set noindex: true (AGENT.md §0c)
- hero background: a full bg-overlay scrim under the text
- MediaValue accepts any object (generated Media types fit without a cast)
- contact: Turnstile renders dark in an inverted section
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
51f80cea13
commit
29ede3ad4b
+12
-7
@@ -91,13 +91,13 @@ block has them) → `variant` (sidebar) → `settings` (sidebar: anchor, backgro
|
||||
|
||||
| Slug (builder) | Panel name | Own fields | Variants | Accessibility |
|
||||
|---|---|---|---|---|
|
||||
| `hero` (`buildHeroBlock`) | Hero / `Sekcja główna` | `media` (image or video), `poster` | `split`, `background`, `centered`, `page` | the first section's heading is the page `h1`; its image is the LCP image (eager, high priority); a background image is decorative (`alt=""`) under a scrim |
|
||||
| `hero` (`buildHeroBlock`) | Hero / `Sekcja główna` | `media` (image or video), `poster` | `split`, `background`, `centered`, `page` | the first section's heading is the page `h1`; its image is the LCP image (eager, high priority); a background image is decorative (`alt=""`) under a full `bg-overlay` scrim (raise `--ipal-overlay` for very light photos) |
|
||||
| `textMedia` (`buildTextMediaBlock`) | Text and image | `content` (rich text), `media` | `mediaRight`, `mediaLeft` | reading order = text first on every screen |
|
||||
| `featureGrid` (`buildFeatureGridBlock`) | Feature grid | `items[]`: `icon` (with `icons`), `media`, `heading`, `text`, `link`; `columns` | `cards`, `list`, `numbered` | a linked feature: its heading is the link and covers the card; a dead link leaves plain text |
|
||||
| `gallery` (`buildGalleryBlock`) | Gallery | `items[]`: `media`, `caption`; `columns` | `grid`, `masonry` | each image a `LightboxTrigger` (keyboard, focus return, labels from Form messages); captions in `<figcaption>` |
|
||||
| `faq` (`buildFaqBlock`) | FAQ | `items[]`: `question`, `answer` | `single`, `twoColumn` | native `<details>`/`<summary>`, works without script |
|
||||
| `cta` (`buildCtaBlock`) | Call to action | `media` | `band`, `card`, `split` | renders nothing without a heading and buttons |
|
||||
| `contact` (`buildContactBlock`) | Contact | `form` (relation), `content` | `formWithDetails`, `formOnly` | `RenderForm` (labels, errors, consent); details as `<dl>` |
|
||||
| `contact` (`buildContactBlock`) | Contact | `form` (relation), `content` | `formWithDetails`, `formOnly` | `RenderForm` (labels, errors, consent); details as `<dl>`; the spam check widget turns dark in an inverted section |
|
||||
| `team` (`buildTeamBlock`) | Team | `items[]`: `media`, `heading` (name), `text` (role), `bio`, `link` | `grid`, `list` | the name is the profile link |
|
||||
| `pricing` (`buildPricingBlock`) | Pricing | `items[]`: `heading`, `price`, `period`, `text`, `features[]`, `highlighted`, `link`; `highlightLabel`, `note` | — | the highlighted plan carries a text label, not only a colour |
|
||||
| `logos` (`buildLogosBlock`) | Logos | `items[]`: `media`, `heading` (name), `link` | `row`, `grid` | the name is the alt text when the image has none; no marquee |
|
||||
@@ -105,7 +105,7 @@ block has them) → `variant` (sidebar) → `settings` (sidebar: anchor, backgro
|
||||
| `stats` (`buildStatsBlock`) | Key figures / `Liczby` | `items[]`: `value`, `heading` (label), `text` | `row`, `cards` | a `<dl>`; static (no count-up animation) |
|
||||
| `richText` (`buildRichTextBlock`) | Text | `content`, `tableOfContents` | `narrow`, `wide` | heading anchors + table of contents (`aria-current` on the section being read) |
|
||||
| `steps` (`buildStepsBlock`) | Steps | `items[]`: `heading`, `text`, `media` | `numbered`, `timeline` | an `<ol>`; the number read as "Step 1" |
|
||||
| `entryList` (`buildEntryListBlock`) | Entry list | `collection`, `mode` (latest / chosen), `limit`, `entries` | `cards`, `list` | each title links to its entry and covers the card; dates in `<time>` |
|
||||
| `entryList` (`buildEntryListBlock`) | Entry list | `entryCollection`, `mode` (latest / chosen), `limit`, `entries` | `cards`, `list` | each title links to its entry and covers the card; dates in `<time>` |
|
||||
|
||||
**Rules every block meets:** one `<section>` with `aria-labelledby` its heading and `data-ipal-block`; `h1` only in the
|
||||
first block (`isFirst` from `createPageRoute`), `h2` otherwise, items `h3`; images through `Media` (alt from the media
|
||||
@@ -140,6 +140,9 @@ the components come from `createBlockRegistry({ icons })`), `testimonials: { col
|
||||
collection as well), `entryList: { collections: [{ label: { en: 'Projects', pl: 'Realizacje' }, value: 'projects' }] }`
|
||||
(default posts), `contact: { formsCollection }` (default `forms`).
|
||||
|
||||
**Field names** never use a path name Mongoose reserves (`collection`, `schema`, `errors`, `get`, `set`…) — MongoDB is
|
||||
on every live site and warns on each start (a test enforces it for the library; keep to it in your own `fields`).
|
||||
|
||||
**Same panel for the project's own blocks:** `buildItemsField({ fields, labels, rowLabelField, maxRows })`,
|
||||
`buildMediaField()`, `buildVariantField({ options })`, `buildIconField({ names })`, `buildContentField()`,
|
||||
`columnsField()` (values `COLUMNS`: `two`, `three`, `four`), `adminText(en, pl)`, `variantOption(value, en, pl)`, and
|
||||
@@ -167,7 +170,9 @@ plugin's components. `content` needs `resolveLink`; `getEntries` (entry list), `
|
||||
|
||||
**UI primitives** (`/blocks/rsc`), each styled once with token utilities: `Section` (anchor, background,
|
||||
`data-surface` for the inverted token scope, spacing, `Container`), `SectionHeader` (eyebrow, `h1`/`h2`, intro),
|
||||
`Media` (image or video; `next/image` when passed), `CMSLink` (a panel link → `Anchor`, with `buttonClass`),
|
||||
`Media` (image or video; `next/image` when passed; `resource` takes any media object, so generated `Media` types fit),
|
||||
`CMSLink` (a panel link → `Anchor`, with `buttonClass`; a link that wraps something — a logo, a card — and leads nowhere
|
||||
keeps its content without a link, so an empty link group never hides it),
|
||||
`buttonClass` / `BUTTON_CLASSES` (button looks by appearance), `Container` / `CONTAINER_WIDTHS`, `Card` / `CARD_CLASS` /
|
||||
`CARD_INTERACTIVE_CLASS`. Helpers for the project's own blocks: `Buttons` (a block's button row), `headingId(block)`
|
||||
(the heading id for `aria-labelledby`), `TitleLink` (a card title that links when its link resolves), `GRID_COLUMNS`,
|
||||
@@ -212,9 +217,9 @@ overwrites an existing file (`--dest`, `--dry-run`).
|
||||
| `service({ form? })` | hero · textMedia · featureGrid (list) · gallery · faq · contact | — |
|
||||
| `contact({ form })` | hero (page) · contact · faq | — |
|
||||
| `blogIndex()` | hero (page) · cta — the entries come from the archive view (docs/content.md) | `postsArchive` |
|
||||
| `post()` | richText (table of contents) · entryList · cta — for a posts collection with a `layout` field | — |
|
||||
| `legal('privacyPolicy' \| 'termsOfService')` | hero (page) · richText (table of contents) — structure only; the wording comes from the client | `privacyPolicy`, `termsOfService` |
|
||||
| `cookiePolicy()` | hero (page) · richText | `cookiePolicy` |
|
||||
| `post({ title })` | hero (page, the post title as `h1`) · richText (table of contents) · entryList · cta — for a posts collection with a `layout` field | — |
|
||||
| `legal('privacyPolicy' \| 'termsOfService')` | hero (page) · richText (table of contents), `noindex: true` — structure only; the wording comes from the client | `privacyPolicy`, `termsOfService` |
|
||||
| `cookiePolicy()` | hero (page) · richText, `noindex: true` | `cookiePolicy` |
|
||||
| `notFound()` | hero (page) with a button home | `notFound` |
|
||||
|
||||
```ts
|
||||
|
||||
Reference in New Issue
Block a user