Skip to content

Releases: kgajera/ngx-contentful-rich-text

v0.9.0

28 Dec 00:28
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.8.0...v0.9.0

v0.8.0

11 Oct 00:13
Compare
Choose a tag to compare

Exports the RendererProviderService in the public API.

v0.7.0

06 Jul 00:39
Compare
Choose a tag to compare

Upgrades library to use Angular 14 to allow publishing an Ivy distribution

v0.6.0

21 Feb 14:13
Compare
Choose a tag to compare

Upgrades @contentful/rich-text-types to version 15

v0.5.1

04 Apr 11:43
Compare
Choose a tag to compare

Fixes a potential error when rendering marks. The MarkRendererHostDirective adds a property, markIndex, to the node object, which in some cases may not be extensible.

v0.5.0

29 Mar 01:46
Compare
Choose a tag to compare

The nodeRenderers and markRenderers inputs of NgxContentfulRichTextComponent now support functions that return the component to use for rendering.

import { Component } from '@angular/core';
import { BLOCKS, MARKS, Document } from '@contentful/rich-text-types';
import { MarkRendererResolver, NodeRendererResolver } from 'ngx-contentful-rich-text';

@Component({
  template: `
    <ngx-contentful-rich-text
      [document]="document"
      [nodeRenderers]="nodeRenderers"
      [markRenderers]="markRenderers"
    >
    </ngx-contentful-rich-text>
  `,
})
export class AppComponent {
  nodeRenderers: Record<string, NodeRendererResolver> = {
    [BLOCKS.EMBEDDED_ENTRY]: (node) => CustomEmbeddedEntryComponent,
  };
  markRenderers: Record<string, MarkRendererResolver> = {
    [MARKS.BOLD]: (node) => CustomBoldComponent,
  };

  document: Document = {};
}