UNPKG

@atlaskit/editor-plugin-tasks-and-decisions

Version:

Tasks and decisions plugin for @atlaskit/editor-core

10 lines 575 B
export const isContentEmpty = node => { if (node.content.childCount === 0) { return true; } if (node.type.name === 'blockTaskItem') { var _node$content$firstCh, _node$content$firstCh2; return node.content.childCount === 1 && ((_node$content$firstCh = node.content.firstChild) === null || _node$content$firstCh === void 0 ? void 0 : _node$content$firstCh.type.name) === 'paragraph' && ((_node$content$firstCh2 = node.content.firstChild) === null || _node$content$firstCh2 === void 0 ? void 0 : _node$content$firstCh2.childCount) === 0; } return false; };