UNPKG

1.73 kBJavaScriptView Raw
1"use strict";
2
3var _module$exports;
4
5function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
7function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
8
9function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
10
11function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
12
13function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
14
15var objectValues = require("object-values");
16
17var BLOCKS = require("./blocks");
18
19var ALL_BLOCKS = objectValues(BLOCKS);
20/**
21 * Map of all block nodes that contains only blocks as children.
22 * The value is the default block type.
23 *
24 * @type {Map<String:Array>}
25 */
26
27module.exports = (_module$exports = {}, _defineProperty(_module$exports, BLOCKS.DOCUMENT, [BLOCKS.PARAGRAPH].concat(_toConsumableArray(ALL_BLOCKS))), _defineProperty(_module$exports, BLOCKS.BLOCKQUOTE, [BLOCKS.TEXT].concat(_toConsumableArray(ALL_BLOCKS))), _defineProperty(_module$exports, BLOCKS.TABLE, [BLOCKS.TABLE_ROW]), _defineProperty(_module$exports, BLOCKS.TABLE_ROW, [BLOCKS.TABLE_CELL]), _defineProperty(_module$exports, BLOCKS.LIST_ITEM, [BLOCKS.TEXT].concat(_toConsumableArray(ALL_BLOCKS))), _defineProperty(_module$exports, BLOCKS.OL_LIST, [BLOCKS.LIST_ITEM]), _defineProperty(_module$exports, BLOCKS.UL_LIST, [BLOCKS.LIST_ITEM]), _module$exports);
\No newline at end of file