@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.
24 lines (20 loc) • 642 B
JavaScript
;
var slate = require('slate');
function withNormalize(editor) {
const { normalizeNode } = editor;
editor.normalizeNode = (entry) => {
const [node, path] = entry;
if (slate.Element.isElement(node) && node.type === "paragraph") {
for (const [child, childPath] of slate.Node.children(editor, path)) {
if (slate.Element.isElement(child) && !editor.isInline(child)) {
slate.Transforms.unwrapNodes(editor, { at: childPath });
return;
}
}
}
normalizeNode(entry);
};
return editor;
}
exports.withNormalize = withNormalize;
//# sourceMappingURL=normalize.cjs.map