Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 🐛 export MARKS and EMPTY_DOCUMENT as ESM friendly #462

Merged
merged 3 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading