Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/npm_and_yarn/deprecated/gatsby-…
Browse files Browse the repository at this point in the history
…transformer-contentful-richtext/express-4.18.2
  • Loading branch information
MayaGillilan authored Aug 4, 2023
2 parents 2adc903 + efbd8a3 commit 812ba9d
Show file tree
Hide file tree
Showing 41 changed files with 964 additions and 72 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions packages/contentful-slatejs-adapter/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [15.16.6](https://github.com/contentful/rich-text/compare/@contentful/contentful-slatejs-adapter@15.16.5...@contentful/contentful-slatejs-adapter@15.16.6) (2023-05-26)

**Note:** Version bump only for package @contentful/contentful-slatejs-adapter

## [15.16.5](https://github.com/contentful/rich-text/compare/@contentful/contentful-slatejs-adapter@15.16.4...@contentful/contentful-slatejs-adapter@15.16.5) (2023-05-04)

**Note:** Version bump only for package @contentful/contentful-slatejs-adapter

## [15.16.4](https://github.com/contentful/rich-text/compare/@contentful/contentful-slatejs-adapter@15.16.3...@contentful/contentful-slatejs-adapter@15.16.4) (2023-04-03)

### Bug Fixes
Expand Down
4 changes: 2 additions & 2 deletions packages/contentful-slatejs-adapter/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@contentful/contentful-slatejs-adapter",
"version": "15.16.4",
"version": "15.16.6",
"description": "",
"keywords": [],
"main": "dist/contentful-slatejs-adapter.es5.js",
Expand Down Expand Up @@ -28,7 +28,7 @@
"report-coverage": "cat ./coverage/lcov.info | coveralls"
},
"dependencies": {
"@contentful/rich-text-types": "^16.0.3"
"@contentful/rich-text-types": "^16.2.0"
},
"devDependencies": {
"@types/jest": "^27.0.1",
Expand Down
8 changes: 8 additions & 0 deletions packages/rich-text-from-markdown/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [15.16.6](https://github.com/contentful/rich-text/compare/@contentful/rich-text-from-markdown@15.16.5...@contentful/rich-text-from-markdown@15.16.6) (2023-05-26)

**Note:** Version bump only for package @contentful/rich-text-from-markdown

## [15.16.5](https://github.com/contentful/rich-text/compare/@contentful/rich-text-from-markdown@15.16.4...@contentful/rich-text-from-markdown@15.16.5) (2023-05-04)

**Note:** Version bump only for package @contentful/rich-text-from-markdown

## [15.16.4](https://github.com/contentful/rich-text/compare/@contentful/rich-text-from-markdown@15.16.3...@contentful/rich-text-from-markdown@15.16.4) (2023-03-14)

**Note:** Version bump only for package @contentful/rich-text-from-markdown
Expand Down
4 changes: 2 additions & 2 deletions packages/rich-text-from-markdown/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@contentful/rich-text-from-markdown",
"version": "15.16.4",
"version": "15.16.6",
"description": "convert markdown to rich text",
"keywords": [
"rich-text",
Expand Down Expand Up @@ -34,7 +34,7 @@
"test": "jest"
},
"dependencies": {
"@contentful/rich-text-types": "^16.0.3",
"@contentful/rich-text-types": "^16.2.0",
"lodash": "^4.17.11",
"remark-gfm": "^1.0.0",
"remark-parse": "^9.0.0",
Expand Down
14 changes: 14 additions & 0 deletions packages/rich-text-html-renderer/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,20 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [16.1.0](https://github.com/contentful/rich-text/compare/@contentful/rich-text-html-renderer@16.0.5...@contentful/rich-text-html-renderer@16.1.0) (2023-06-09)

### Features

- add default renderer for the node ([#472](https://github.com/contentful/rich-text/issues/472)) ([5a53caf](https://github.com/contentful/rich-text/commit/5a53cafc58aa8d009d2aa2d6cb4fa2d6cee6b19d))

## [16.0.5](https://github.com/contentful/rich-text/compare/@contentful/rich-text-html-renderer@16.0.4...@contentful/rich-text-html-renderer@16.0.5) (2023-05-26)

**Note:** Version bump only for package @contentful/rich-text-html-renderer

## [16.0.4](https://github.com/contentful/rich-text/compare/@contentful/rich-text-html-renderer@16.0.3...@contentful/rich-text-html-renderer@16.0.4) (2023-05-04)

**Note:** Version bump only for package @contentful/rich-text-html-renderer

## [16.0.3](https://github.com/contentful/rich-text/compare/@contentful/rich-text-html-renderer@16.0.2...@contentful/rich-text-html-renderer@16.0.3) (2023-03-14)

**Note:** Version bump only for package @contentful/rich-text-html-renderer
Expand Down
1 change: 1 addition & 0 deletions packages/rich-text-html-renderer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ The `renderNode` keys should be one of the following `BLOCKS` and `INLINES` prop
- `HR`
- `EMBEDDED_ENTRY`
- `EMBEDDED_ASSET`
- `EMBEDDED_RESOURCE`

- `INLINES`
- `EMBEDDED_ENTRY` (this is different from the `BLOCKS.EMBEDDED_ENTRY`)
Expand Down
4 changes: 2 additions & 2 deletions packages/rich-text-html-renderer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@contentful/rich-text-html-renderer",
"version": "16.0.3",
"version": "16.1.0",
"main": "dist/rich-text-html-renderer.es5.js",
"typings": "dist/types/index.d.ts",
"files": [
Expand All @@ -25,7 +25,7 @@
"test": "jest"
},
"dependencies": {
"@contentful/rich-text-types": "^16.0.3",
"@contentful/rich-text-types": "^16.2.0",
"escape-html": "^1.0.3"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { Document, BLOCKS, ResourceLink } from '@contentful/rich-text-types';

export default function (resourceLink: ResourceLink) {
return {
nodeType: BLOCKS.DOCUMENT,
data: {},
content: [
{
nodeType: BLOCKS.EMBEDDED_RESOURCE,
content: [],
data: {
target: resourceLink,
},
},
],
} as Document;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export { default as paragraphDoc } from './paragraph';
export { default as headingDoc } from './heading';
export { default as marksDoc } from './mark';
export { default as embeddedEntryDoc } from './embedded-entry';
export { default as embeddedResourceDoc } from './embedded-entry';
export { default as olDoc } from './ol';
export { default as ulDoc } from './ul';
export { default as quoteDoc } from './quote';
Expand Down
17 changes: 16 additions & 1 deletion packages/rich-text-html-renderer/src/__test__/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import cloneDeep from 'lodash/cloneDeep';
import { Block, BLOCKS, Document, INLINES, MARKS } from '@contentful/rich-text-types';
import { Block, BLOCKS, Document, INLINES, MARKS, ResourceLink } from '@contentful/rich-text-types';
import { documentToHtmlString, Options } from '../index';
import {
embeddedEntryDoc,
Expand All @@ -15,6 +15,7 @@ import {
quoteDoc,
ulDoc,
tableWithHeaderDoc,
embeddedResourceDoc,
} from './documents';
import inlineEntity from './documents/inline-entity';

Expand Down Expand Up @@ -183,6 +184,20 @@ describe('documentToHtmlString', () => {
expect(documentToHtmlString(document)).toEqual(expected);
});

it('renders default resource link block', () => {
const resourceLink: ResourceLink = {
sys: {
urn: 'crn:contentful:::content:spaces/6fqi4ljzyr0e/entries/9mpxT4zsRi6Iwukey8KeM',
type: 'ResourceLink',
linkType: 'Contentful:Entry',
},
};
const document: Document = embeddedResourceDoc(resourceLink);
const expected = `<div></div>`;

expect(documentToHtmlString(document)).toEqual(expected);
});

it('renders ordered lists', () => {
const document: Document = olDoc;
const expected = `<ol><li><p>Hello</p></li><li><p>world</p></li></ol><p></p>`;
Expand Down
1 change: 1 addition & 0 deletions packages/rich-text-html-renderer/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const defaultNodeRenderers: RenderNode = {
[BLOCKS.HEADING_5]: (node, next) => `<h5>${next(node.content)}</h5>`,
[BLOCKS.HEADING_6]: (node, next) => `<h6>${next(node.content)}</h6>`,
[BLOCKS.EMBEDDED_ENTRY]: (node, next) => `<div>${next(node.content)}</div>`,
[BLOCKS.EMBEDDED_RESOURCE]: (node, next) => `<div>${next(node.content)}</div>`,
[BLOCKS.UL_LIST]: (node, next) => `<ul>${next(node.content)}</ul>`,
[BLOCKS.OL_LIST]: (node, next) => `<ol>${next(node.content)}</ol>`,
[BLOCKS.LIST_ITEM]: (node, next) => `<li>${next(node.content)}</li>`,
Expand Down
34 changes: 34 additions & 0 deletions packages/rich-text-links/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,40 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [16.4.0](https://github.com/contentful/rich-text/compare/@contentful/rich-text-links@16.3.0...@contentful/rich-text-links@16.4.0) (2023-07-10)

### Features

- allow document parameter to be nullable ([#471](https://github.com/contentful/rich-text/issues/471)) ([e50f8d2](https://github.com/contentful/rich-text/commit/e50f8d24c60a74f43f84f415a5c393038919efd2))

# [16.3.0](https://github.com/contentful/rich-text/compare/@contentful/rich-text-links@16.2.0...@contentful/rich-text-links@16.3.0) (2023-06-09)

### Features

- change visitNodes to visit nodes in depth-first order ([#475](https://github.com/contentful/rich-text/issues/475)) ([ace5225](https://github.com/contentful/rich-text/commit/ace52253af4e83035075a466b7c97a08072e35ad))

# [16.2.0](https://github.com/contentful/rich-text/compare/@contentful/rich-text-links@16.1.1...@contentful/rich-text-links@16.2.0) (2023-06-07)

### Features

- add deduplicate option to getRichTextResourceLinks ([#470](https://github.com/contentful/rich-text/issues/470)) ([1141d5b](https://github.com/contentful/rich-text/commit/1141d5b6848e32efce198ad2d47b6442a9660aa0))

## [16.1.1](https://github.com/contentful/rich-text/compare/@contentful/rich-text-links@16.1.0...@contentful/rich-text-links@16.1.1) (2023-05-31)

### Bug Fixes

- prevent crash when a null value is passed as document ([#468](https://github.com/contentful/rich-text/issues/468)) ([3c8531c](https://github.com/contentful/rich-text/commit/3c8531cbcdde623c66c4b13d49fff73cad096871))

# [16.1.0](https://github.com/contentful/rich-text/compare/@contentful/rich-text-links@16.0.4...@contentful/rich-text-links@16.1.0) (2023-05-26)

### Features

- 🎸 add `getRichTextResourceLinks` ([#465](https://github.com/contentful/rich-text/issues/465)) ([5746ba6](https://github.com/contentful/rich-text/commit/5746ba652ae5eac2df27d05193e19aef9e85c438))

## [16.0.4](https://github.com/contentful/rich-text/compare/@contentful/rich-text-links@16.0.3...@contentful/rich-text-links@16.0.4) (2023-05-04)

**Note:** Version bump only for package @contentful/rich-text-links

## [16.0.3](https://github.com/contentful/rich-text/compare/@contentful/rich-text-links@16.0.2...@contentful/rich-text-links@16.0.3) (2023-03-14)

**Note:** Version bump only for package @contentful/rich-text-links
Expand Down
4 changes: 2 additions & 2 deletions packages/rich-text-links/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@contentful/rich-text-links",
"version": "16.0.3",
"version": "16.4.0",
"main": "dist/rich-text-links.es5.js",
"typings": "dist/types/index.d.ts",
"files": [
Expand All @@ -25,7 +25,7 @@
"test": "jest"
},
"dependencies": {
"@contentful/rich-text-types": "^16.0.3"
"@contentful/rich-text-types": "^16.2.0"
},
"devDependencies": {
"jest": "^27.1.0",
Expand Down
Loading

0 comments on commit 812ba9d

Please sign in to comment.