Block library: 15 blocks, registry, primitives, templates, manifest, eject

- @intecion/ipal-kit/blocks: libraryBlocks() opt-in, one builder per block, field
  builders, option merging, blockLibraryManifest, faqItemsFromLayout
- @intecion/ipal-kit/blocks/rsc: createBlockRegistry, the block components and UI
  primitives (token utilities only; next/image and next/link passed in)
- @intecion/ipal-kit/templates: 10 page templates as createSeeder data
- createSeeder: { $form: title } references
- ipal-blocks eject <block>
- tests: options, rendering and a11y per block, Payload + seeding, GraphQL, admin
  wording, schema snapshot (versioning), eject imports
- shorter admin labels: link "New tab", table of contents "Show contents"

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-10-29 14:05:47 +01:00
co-authored by Claude Opus 5.5
parent 7918eaf6d4
commit 2d1cc0e77d
73 changed files with 5091 additions and 9 deletions
+12
View File
@@ -2,6 +2,7 @@ import type { CollectionConfig, Config, Field, GlobalConfig } from 'payload'
import { describe, expect, test } from 'vitest'
import { LIBRARY_BLOCK_SLUGS, libraryBlocks } from '../src/exports/blocks.js'
import { applyAdminI18n } from '../src/modules/admin-i18n/apply.js'
import { adminTexts } from '../src/modules/admin-i18n/index.js'
import { ipalKit } from '../src/plugin.js'
@@ -195,6 +196,17 @@ describe('admin wording (docs/dev/admin-ux.md)', () => {
expect(problems).toEqual([])
})
test('block library: every block, en + pl, within limits', () => {
const problems: Problem[] = []
const blocks = libraryBlocks({
...Object.fromEntries(LIBRARY_BLOCK_SLUGS.map((slug) => [slug, true])),
featureGrid: { icons: ['phone'] },
testimonials: { collection: 'testimonials' },
})
walk([{ name: 'layout', type: 'blocks', blocks, label: { en: 'Sections', pl: 'Sekcje' } } as Field], 'pages', problems)
expect(problems).toEqual([])
})
test('component texts: same keys in en and pl, none empty, no developer words', () => {
const en = adminTexts.en as Record<string, string>
const pl = adminTexts.pl as Record<string, string>