smart-blocks-utils
v1.0.1
Published
Shared React utilities for rendering Pushwoosh smart blocks.
Readme
smart-blocks-utils
Shared React utilities for rendering Pushwoosh smart blocks.
Install
npm install smart-blocks-utilsUsage
import { DocumentReader, type BuilderDocument } from 'smart-blocks-utils';
export function Preview({ document }: { document: BuilderDocument }) {
return <DocumentReader document={document} />;
}DocumentReader renders a BuilderDocument (cards, columns, text, button groups, images) using the document's settings, text variants, and default styles.
Public API
DocumentReader— React component that renders a builder document.BuilderDocument— type describing the document shape (pageId,items,settings,textVariants,colorScheme,meta).
Development
npm install # Node >= 22
npm run check # eslint + type-check (runs as pre-commit)
npm run check:lint # eslint only
npm run check:types # type-check only
npm run build # tsc -> dist/Published to the public npm registry by GitLab CI on tags.
