Open-source and local-first Slack and Notion alternative that puts you in control of your data
TypeScript chatchat-applicationcrdteditorelectronknowledge-baselocal-firstnotionnotion-alternativerealtime-collaborationself-hostedslacksqliteteam-collaborationwikiyjs
import { mergeAttributes, Node } from '@tiptap/core';
import { ReactNodeViewRenderer } from '@tiptap/react';
import { DatabaseNodeView } from '@colanode/ui/editor/views';
export const DatabaseNode = Node.create({
name: 'database',
group: 'block',
atom: true,
defining: true,
draggable: true,
addAttributes() {
return {
id: {
default: null,
},
inline: {
default: false,
},
};
},
renderHTML({ HTMLAttributes }) {
return ['page', mergeAttributes(HTMLAttributes)];
},
addNodeView() {
return ReactNodeViewRenderer(DatabaseNodeView, {
as: 'database',
});
},
});