UNPKG

@liveblocks/react-blocknote

Version:

An integration of BlockNote + React to enable collaboration, comments, live cursors, and more with Liveblocks.

31 lines (27 loc) 811 B
'use strict'; var core = require('@blocknote/core'); var reactTiptap = require('@liveblocks/react-tiptap'); const mentionSpec = core.createInlineContentSpecFromTipTapNode(reactTiptap.MentionNode, { id: { default: "" }, notificationId: { default: "" } }); const withLiveblocksSchema = (schema, liveblocksOptions = {}) => { const optionalSchema = schema || core.BlockNoteSchema.create(); if (!liveblocksOptions.mentions) { return optionalSchema; } return core.BlockNoteSchema.create({ blockSpecs: optionalSchema.blockSpecs, inlineContentSpecs: { ...optionalSchema.inlineContentSpecs, liveblocksMention: mentionSpec }, styleSpecs: optionalSchema.styleSpecs }); }; exports.withLiveblocksSchema = withLiveblocksSchema; //# sourceMappingURL=schema.cjs.map