KO
베타 번역

@core / blocks

1.0.0 ▾
인증됨MIT
GitHub

페이지 블록: 접근성 갖춘 15개 섹션(히어로, 가격, JSON-LD FAQ 등), 관리자 편집기, 확장 가능한 등록

코드파일 25개컨텍스트약 681토큰검사 통과

.genpmignore 적용 후 주입될 정확한 트리입니다. 고정 대상:

src/lib/blocks/core/form.ts읽기 전용 · a255d6d
import { z } from 'zod';
import { createElement as h } from 'react';
import { defineBlock } from '../define.ts';
import { optText, Section, text } from '../parts.ts';

export const form = defineBlock({
  type: 'form',
  label: 'Form',
  icon: 'form',
  schema: z.object({ title: optText(160), intro: optText(400), formKey: text(60) }),
  fields: [
    { name: 'title', label: 'Title', type: 'text' },
    { name: 'intro', label: 'Introduction', type: 'textarea' },
    { name: 'formKey', label: 'Form', type: 'text', required: true, help: 'Key of a form defined with @core/forms (e.g. "contact").' },
  ],
  defaults: () => ({ formKey: 'contact' }),
  Component: ({ data, ctx }) => {
    const rendered = ctx.renderForm?.(data.formKey);
    if (!rendered) return null;
    return h(Section, { id: ctx.id, block: 'form', title: data.title, intro: data.intro, ctx, label: 'Form' }, rendered);
  },
});

@core/blocks 신고

패키지를 신고하려면 GitHub로 로그인하세요.