Skip to content

Commit

Permalink
fix: πŸ› export MARKS and EMPTY_DOCUMENT as ESM friendly (#462)
Browse files Browse the repository at this point in the history
Co-authored-by: Kudakwashe Mupeni <[email protected]>
Co-authored-by: Yves Rijckaert <[email protected]>
  • Loading branch information
3 people authored Mar 4, 2024
1 parent 01408ed commit 7ea8ab3
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
4 changes: 1 addition & 3 deletions packages/rich-text-types/src/emptyDocument.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { BLOCKS } from './blocks';
* A rich text document considered to be empty.
* Any other document structure than this is not considered empty.
*/
const EMPTY_DOCUMENT: Document = {
export const EMPTY_DOCUMENT: Document = {
nodeType: BLOCKS.DOCUMENT,
data: {},
content: [
Expand All @@ -23,5 +23,3 @@ const EMPTY_DOCUMENT: Document = {
},
],
};

export default EMPTY_DOCUMENT;
4 changes: 2 additions & 2 deletions packages/rich-text-types/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
export { BLOCKS } from './blocks';
export { INLINES } from './inlines';
export { default as MARKS } from './marks';
export { MARKS } from './marks';

export * from './schemaConstraints';

export * from './types';
export * from './nodeTypes';

export { default as EMPTY_DOCUMENT } from './emptyDocument';
export { EMPTY_DOCUMENT } from './emptyDocument';

import * as helpers from './helpers';
export { helpers };
4 changes: 1 addition & 3 deletions packages/rich-text-types/src/marks.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
/**
* Map of all Contentful marks.
*/
enum MARKS {
export enum MARKS {
BOLD = 'bold',
ITALIC = 'italic',
UNDERLINE = 'underline',
CODE = 'code',
SUPERSCRIPT = 'superscript',
SUBSCRIPT = 'subscript',
}

export default MARKS;
2 changes: 1 addition & 1 deletion packages/rich-text-types/src/schemaConstraints.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { BLOCKS } from './blocks';
import { INLINES } from './inlines';
import MARKS from './marks';
import { MARKS } from './marks';

export type TopLevelBlockEnum =
| BLOCKS.PARAGRAPH
Expand Down

0 comments on commit 7ea8ab3

Please sign in to comment.