@crystallize/content-chunk

Validation and parsing for CCC

Stats

StarsIssuesVersionUpdatedCreatedSize
@crystallize/content-chunk
103.4.42 years ago4 years agoMinified + gzip package size for @crystallize/content-chunk in KB

Readme

alt text

crystallize-content-chunk

Validation, parsing and React rendering for Crystallize Content Chunk. Makes it easy to build React Commerce solutions with Product Information Management powered by Crystallize that enable Fast Ecommerce API.

Install

yarn add @crystallize/content-chunk

Validate

import CCC from '@crystallize/content-chunk'

const isValid = CCC.isModelValid(myModel)
const validationDetails = CCC.isModelValidVerbose(myModel)

React chunk

import Chunk from '@crystallize/content-chunk/reactChunk';

const overrides = {
  link: p => <MyLinkComponent href={p.metadata.href}>{p.textContent}</MyLinkComponent>
};

<Chunk {...cccModel} overrides={overrides} />

toHTML

import toHTML from '@crystallize/content-chunk/toHTML';

toHtml(cccModel);

toText

import toText from '@crystallize/content-chunk/toText';

toText(cccModel);

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.