UNPKG

@liveblocks/react-ui

Version:

A set of React pre-built components for the Liveblocks products. Liveblocks is the all-in-one toolkit to build collaborative products like Figma, Notion, and more.

28 lines (24 loc) 741 B
'use strict'; var slate = require('slate'); var isEmptyString = require('./is-empty-string.cjs'); var isText = require('./is-text.cjs'); function isEmpty(editor, children) { for (const child of children) { if (isText.isText(child)) { if (!isEmptyString.isEmptyString(child.text)) { return false; } } else if (child.type === "paragraph") { if (child.children.length > 1 || child.children[0] && !(isText.isText(child.children[0]) && isEmptyString.isEmptyString(child.children[0].text))) { return false; } } else { if (!slate.Editor.isEmpty(editor, child)) { return false; } } } return true; } exports.isEmpty = isEmpty; //# sourceMappingURL=is-empty.cjs.map