UNPKG

@atlaskit/adf-schema

Version:

Shared package that contains the ADF-schema (json) and ProseMirror node/mark specs

15 lines (14 loc) 734 B
import { COLOR, FONT_STYLE, SEARCH_QUERY, LINK } from './groups'; // We use groups to allow schemas to be constructed in different shapes without changing node/mark // specs, but this means nodes/marks are defined with groups that might never be used in the schema. // In this scenario ProseMirror will complain and prevent the schema from being constructed. function groupDeclaration(name) { return { name: `__${name}GroupDeclaration`, spec: { group: name } }; } export const markGroupDeclarations = [groupDeclaration(COLOR), groupDeclaration(FONT_STYLE), groupDeclaration(SEARCH_QUERY), groupDeclaration(LINK)]; export const markGroupDeclarationsNames = markGroupDeclarations.map(groupMark => groupMark.name);