@nacelle/rich-text-utils
Version:
A set of Typescript types and helpers to work with Rich Text fields.
81 lines • 2.42 kB
JavaScript
export const blockquoteNodeType = 'blockquote';
export const blockNodeType = 'block';
export const codeNodeType = 'code';
export const headingNodeType = 'heading';
export const inlineEntryNodeType = 'inlineEntry';
export const entryLinkNodeType = 'entryLink';
export const linkNodeType = 'link';
export const listItemNodeType = 'listItem';
export const listNodeType = 'list';
export const paragraphNodeType = 'paragraph';
export const rootNodeType = 'root';
export const spanNodeType = 'span';
export const thematicBreakNodeType = 'thematicBreak';
export const allowedNodeTypes = [
blockquoteNodeType,
blockNodeType,
codeNodeType,
headingNodeType,
inlineEntryNodeType,
entryLinkNodeType,
linkNodeType,
listItemNodeType,
listNodeType,
paragraphNodeType,
rootNodeType,
spanNodeType,
thematicBreakNodeType,
];
export const allowedChildren = {
[]: [paragraphNodeType],
[]: [],
[]: [],
[]: 'inlineNodes',
[]: [],
[]: 'inlineNodes',
[]: 'inlineNodes',
[]: [paragraphNodeType, listNodeType],
[]: [listItemNodeType],
[]: 'inlineNodes',
[]: [
blockquoteNodeType,
codeNodeType,
listNodeType,
paragraphNodeType,
headingNodeType,
blockNodeType,
thematicBreakNodeType,
],
[]: [],
[]: [],
};
export const inlineNodeTypes = [
spanNodeType,
linkNodeType,
entryLinkNodeType,
inlineEntryNodeType,
];
export const allowedAttributes = {
[]: ['children', 'attribution'],
[]: ['entry'],
[]: ['language', 'highlight', 'code'],
[]: ['level', 'children'],
[]: ['entry'],
[]: ['entry', 'children', 'meta'],
[]: ['url', 'children', 'meta'],
[]: ['children'],
[]: ['style', 'children'],
[]: ['children'],
[]: ['children'],
[]: ['value', 'marks'],
[]: [],
};
export const allowedMarks = [
'strong',
'code',
'emphasis',
'underline',
'strikethrough',
'highlight',
];
//# sourceMappingURL=definitions.js.map