Skip to content

Open-source and local-first Slack and Notion alternative that puts you in control of your data

429 B
Raw Blame
import { Heading1 } from 'lucide-react';

import { EditorCommand } from '@colanode/client/types';

export const Heading1Command: EditorCommand = {
  key: 'heading1',
  name: 'Heading 1',
  description: 'Insert a heading 1 element',
  keywords: ['heading', 'heading2', 'h1'],
  icon: Heading1,
  disabled: false,
  handler: ({ editor, range }) => {
    editor.chain().focus().deleteRange(range).setNode('heading1').run();
  },
};