Block library: docs, agent guide, skills; picker order as an explicit list
- docs/block-library.md: setup, every block (fields, variants, accessibility), options, registry, primitives, eject, page templates, seeding after launch, versioning, manifest, turn off / override / extend - AGENT.md (compass, how to add, §6, §6.3, module map), ipal-block (library block first), ipal-site (phases 2, 4, 6, 8), ipal-reference (wiring rows, export index), seed-content template from pageTemplates, seeding.md ($form) - CHANGELOG Unreleased; proposal marked built with an as-built section Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
2d1cc0e77d
commit
2a07fb8844
+16
-2
@@ -134,6 +134,8 @@ export function Offer({ header, items }: OfferBlockProps) { return <Section head
|
||||
`docs/dev/admin-ux.md`); no empty "just in case" fields.
|
||||
7. **Renderers from the plugin:** `RenderBlocks` (not a `switch`), `RenderRichText` (not
|
||||
your own Lexical parser), `useForm` (not hand-made form plumbing).
|
||||
**Sections from the block library first:** `libraryBlocks` + `createBlockRegistry` (15 ready blocks,
|
||||
docs/block-library.md); an own block only when no library block, variant or option fits.
|
||||
8. **No `any` and no `@ts-ignore`.** Types from `@/payload-types`, `unknown` + guard.
|
||||
9. **One source of truth** — `i18n.config.ts`, `lib/content.ts`, never copies.
|
||||
10. **"Done" only after** a local `pnpm build` + the checks from §11.
|
||||
@@ -145,7 +147,8 @@ export function Offer({ header, items }: OfferBlockProps) { return <Section head
|
||||
| What | How |
|
||||
|---|---|
|
||||
| a page | in the panel: Pages + blocks, no code (§5.1) |
|
||||
| a section (block) | `src/blocks/<Name>/config.ts` + `Component.tsx`, an entry in `blocks/registry.ts`, the block in the Pages `layout` field → `pnpm generate:types` (+ `pnpm payload generate:importmap` with `rowLabel`) — **ipal-block** |
|
||||
| a section (block) | a library block first: `blockOptions` → `libraryBlocks` in `src/blocks/configs.ts`, `createBlockRegistry(content, { Image, Link, sendForm })` in `blocks/registry.ts` (docs/block-library.md). None fits → `src/blocks/<Name>/config.ts` + `Component.tsx`, `extra` in the registry, `pageBlocks` → `pnpm generate:types` (+ `pnpm payload generate:importmap` with `rowLabel`) — **ipal-block** |
|
||||
| a standard page (home, about, services, contact, legal, 404…) | `pageTemplates` from `@intecion/ipal-kit/templates` in the content seed (after launch only with `SEED_ONLY`) — **ipal-site** phase 6 |
|
||||
| a form | the Forms panel (builder) from the seed `scripts/seed-form-*.ts`, a block with `<RenderForm>`, sending via `sendForm` — **ipal-form** |
|
||||
| a language | `i18n.config.ts` (the only place) + a Postgres migration + content in the new language — **ipal-locale-add** |
|
||||
| a collection with URLs | `content: { collections: [...] }` in `ipalKit` and `createContentHelpers` (§5.4) — **ipal-collection** |
|
||||
@@ -565,6 +568,13 @@ never by slug. pages.md.
|
||||
|
||||
## 6. BUILDING SECTIONS (`.tsx` blocks)
|
||||
|
||||
**Block library first.** The plugin ships 15 sections built to every rule below — `hero`, `textMedia`,
|
||||
`featureGrid`, `cta`, `richText`, `faq`, `contact`, `gallery`, `testimonials`, `stats`, `steps`, `logos`, `team`,
|
||||
`pricing`, `entryList` — with variants, `{ en, pl }` panels, accessibility and token-only styling, plus ten page
|
||||
templates ([block-library.md](../block-library.md)). Turn them on with `libraryBlocks(blockOptions)`, render them with
|
||||
`createBlockRegistry`, change them with their options (`fields`, `variants`, `classNames`, `ui`, `components`), own one
|
||||
with `ipal-blocks eject`. The rules below are how those blocks are built and how you build your own when none fits.
|
||||
|
||||
Three problems that must never repeat: **a zoo of CTA fields** (`ctaLabel`,
|
||||
`cta2Text`, `buttonUrl`…), **files as text** (`pdfUrl: '/files/x.pdf'`),
|
||||
**the monolith section** (200–400 lines with cards, SVG icons and button styles).
|
||||
@@ -624,7 +634,10 @@ Field labels as `{ en, pl }` objects (the panel runs in English and Polish; §6.
|
||||
|
||||
### 6.3 Layer 2 — UI primitives
|
||||
|
||||
Code 1:1: [section-code.md](./skills/ipal-block/resources/section-code.md). Each one has one job:
|
||||
With the block library they come from the plugin: `Section`, `SectionHeader`, `Media`, `CMSLink`, `buttonClass`,
|
||||
`Container`, `Card` from `@intecion/ipal-kit/blocks/rsc` (no project copies; `src/components/ui/` holds only a
|
||||
project version you pass in with `createBlockRegistry(content, { ui: { Media } })`). A project without the library:
|
||||
code 1:1 from [section-code.md](./skills/ipal-block/resources/section-code.md). Each one has one job:
|
||||
|
||||
| Primitive | Does | Instead of |
|
||||
|---|---|---|
|
||||
@@ -1245,6 +1258,7 @@ Anything that needs a developer → move it to the panel.
|
||||
| Accessibility widget (optional) | [accessibility.md](../accessibility.md) |
|
||||
| GA4, GTM, Meta Pixel, Clarity, LinkedIn, TikTok | [analytics.md](../analytics.md) |
|
||||
| Blocks, RenderBlocks, enhanceProps | [blocks.md](../blocks.md) |
|
||||
| Block library: 15 ready sections, page templates, eject | [block-library.md](../block-library.md) |
|
||||
| Cookie consent, banner | [consent.md](../consent.md) |
|
||||
| Cookie scanner (review list, Open Cookie Database) | [cookie-scanner.md](../cookie-scanner.md) |
|
||||
| Routing, archives, redirects, Markdown, search | [content.md](../content.md) |
|
||||
|
||||
Reference in New Issue
Block a user