-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 🎸 Explicitly declare nodeClass and nodeType in core types
This is necessary to ensure disambiguation between block, inline, and text elements. Additionally, this codifies the rich text specification as provided by the CEP (alternatives wouldn't make it through our validation layer, and should not be supported as such). BREAKING CHANGE: Potentially breaks TypeScript libraries pulling this in as a dependency if they are not explicitly stating nodeClass and nodeType.
- Loading branch information
Chris Sloop
committed
Oct 30, 2018
1 parent
3a74778
commit 0749c61
Showing
16 changed files
with
106 additions
and
13 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
packages/rich-text-html-renderer/src/__test__/documents/embedded-entry.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
packages/rich-text-html-renderer/src/__test__/documents/heading.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
packages/rich-text-html-renderer/src/__test__/documents/quote.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,35 @@ | ||
import { Document } from '@contentful/rich-text-types'; | ||
|
||
export default { | ||
data: {}, | ||
content: [ | ||
{ | ||
data: {}, | ||
content: [ | ||
{ | ||
data: {}, | ||
marks: [], | ||
value: 'hello', | ||
nodeType: 'text', | ||
}, | ||
], | ||
nodeType: 'paragraph', | ||
nodeClass: 'block', | ||
}, | ||
{ | ||
data: {}, | ||
content: [ | ||
{ | ||
data: {}, | ||
marks: [], | ||
value: 'world', | ||
nodeType: 'text', | ||
}, | ||
], | ||
nodeType: 'blockquote', | ||
nodeClass: 'block', | ||
}, | ||
], | ||
nodeType: 'document', | ||
nodeClass: 'block', | ||
} as Document; |
Oops, something went wrong.