- @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]>
24 lines
1.0 KiB
TypeScript
24 lines
1.0 KiB
TypeScript
import { adminText, defineLibraryBlock, variantOption } from '../../define.js'
|
|
import { buildItemsField, buildMediaField } from '../../fields.js'
|
|
|
|
export const STEPS_VARIANTS = [variantOption('numbered', 'Numbered', 'Numerowane'), variantOption('timeline', 'Timeline', 'Oś czasu')] as const
|
|
|
|
/** Steps — a process or timeline in order. */
|
|
export const buildStepsBlock = defineLibraryBlock({
|
|
slug: 'steps',
|
|
fields: ({ maxItems = 10 }) => [
|
|
buildItemsField({
|
|
fields: [
|
|
{ name: 'heading', type: 'text', label: adminText('Heading', 'Nagłówek'), localized: true, required: true },
|
|
{ name: 'text', type: 'textarea', admin: { rows: 3 }, label: adminText('Text', 'Tekst'), localized: true },
|
|
buildMediaField(),
|
|
],
|
|
labels: { plural: adminText('Steps', 'Kroki'), singular: adminText('Step', 'Krok') },
|
|
maxRows: maxItems,
|
|
}),
|
|
],
|
|
interfaceName: 'StepsBlock',
|
|
labels: { plural: adminText('Steps', 'Kroki'), singular: adminText('Steps', 'Kroki') },
|
|
variants: STEPS_VARIANTS,
|
|
})
|