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