UNPKG

575 BJavaScriptView Raw
1'use strict';
2
3var getCurrentItem = require('./getCurrentItem');
4var getListForItem = require('./getListForItem');
5
6/**
7 * Return the parent list block, from current selection or from a node (paragraph in a list item).
8 *
9 * @param {PluginOptions} opts
10 * @param {Slate.Value} value
11 * @param {Slate.Block} block?
12 * @return {Slate.Block || Void}
13 */
14function getCurrentList(opts, value, block) {
15 var item = getCurrentItem(opts, value, block);
16
17 if (!item) {
18 return null;
19 }
20
21 return getListForItem(opts, value, item);
22}
23
24module.exports = getCurrentList;
\No newline at end of file