UNPKG

614 BJavaScriptView Raw
1const objectValues = require("object-values");
2
3const BLOCKS = require("./blocks");
4
5const ALL_BLOCKS = objectValues(BLOCKS);
6/**
7 * Map of all block nodes that contains only blocks as children.
8 * The value is the default block type.
9 *
10 * @type {Map<String:Array>}
11 */
12
13module.exports = {
14 [BLOCKS.DOCUMENT]: [BLOCKS.PARAGRAPH, ...ALL_BLOCKS],
15 [BLOCKS.BLOCKQUOTE]: [BLOCKS.TEXT, ...ALL_BLOCKS],
16 [BLOCKS.TABLE]: [BLOCKS.TABLE_ROW],
17 [BLOCKS.TABLE_ROW]: [BLOCKS.TABLE_CELL],
18 [BLOCKS.LIST_ITEM]: [BLOCKS.TEXT, ...ALL_BLOCKS],
19 [BLOCKS.OL_LIST]: [BLOCKS.LIST_ITEM],
20 [BLOCKS.UL_LIST]: [BLOCKS.LIST_ITEM]
21};
\No newline at end of file