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 { FolderNodeView } from '@colanode/ui/editor/views';
export const FolderNode = Node.create({
name: 'folder',
group: 'block',
atom: true,
defining: true,
draggable: true,
addAttributes() {
return {
id: {
default: null,
},
};
},
renderHTML({ HTMLAttributes }) {
return ['folder', mergeAttributes(HTMLAttributes)];
},
addNodeView() {
return ReactNodeViewRenderer(FolderNodeView, {
as: 'folder',
});
},
});