@liveblocks/react-blocknote
Version:
An integration of BlockNote + React to enable collaboration, comments, live cursors, and more with Liveblocks.
33 lines (29 loc) • 1.09 kB
JavaScript
;
var core = require('@blocknote/core');
var schema = require('./schema.cjs');
const withLiveblocksEditorOptions = (liveblocksExtension, blocknoteOptions = {}, liveblocksOptions = {}) => {
const {
schema: blocknoteSchema,
extensions: blocknoteExtensions,
disableExtensions: blocknoteDisableExtensions,
...extraBlocknoteOptions
} = blocknoteOptions;
return {
// add the liveblocks schema (i.e.: add the mentions nodes to the schema)
schema: schema.withLiveblocksSchema(blocknoteSchema, liveblocksOptions),
// add the liveblocks extension
extensions: [
core.createBlockNoteExtension({
key: "liveblocksExtension",
tiptapExtensions: [liveblocksExtension]
}),
...blocknoteExtensions ?? []
],
// disable the history extension
disableExtensions: ["history", ...blocknoteDisableExtensions || []],
// pass the rest of the options through
...extraBlocknoteOptions
};
};
exports.withLiveblocksEditorOptions = withLiveblocksEditorOptions;
//# sourceMappingURL=liveblocksEditorOptions.cjs.map