@nailthelanding/blocks
v0.13.1
Published
Puck block library for Nail The Landing templates
Readme
@nailthelanding/blocks
Puck block library used by Nail The Landing templates.
Provides a small set of landing-page-focused Puck blocks (layout, content, profile, link list, social icons, media embeds) plus two Puck configs:
@nailthelanding/blocks/config— full editor config, including custom fields (RichTextField for Tiptap, ImageUploadField for R2 presigned uploads). Use this when rendering the Puck editor.@nailthelanding/blocks/render-config— render-only config, no custom fields, safe to import from server components and SSR builds. No Tiptap, no DOMPurify, no browser-only globals at module load.
Install
npm install @nailthelanding/blocks @puckeditor/core react react-domUsage (editor)
import { Puck } from '@puckeditor/core';
import { buildConfig } from '@nailthelanding/blocks/config';
const config = buildConfig({
presign: async (file) => {
// return { uploadUrl, objectKey, finalUrl }
},
});
export const Editor = ({ data, onChange }) => (
<Puck config={config} data={data} onChange={onChange} />
);Usage (render)
import { Render } from '@puckeditor/core';
import { buildRenderConfig } from '@nailthelanding/blocks/render-config';
const config = buildRenderConfig();
export const Page = ({ data }) => (
<Render config={config} data={data} />
);Development
npm install
npm run build # build ./dist
npm test # run testsLicense
MIT
