import { IconNotes } from '@tabler/icons-react'; import dynamic from 'next/dynamic'; import { defineWidget } from '../helper'; import { IWidget } from '../widgets'; const Editor = dynamic(() => import('./NotebookEditor').then((module) => module.Editor), { ssr: false, }); const definition = defineWidget({ id: 'notebook', icon: IconNotes, options: { showToolbar: { type: 'switch', defaultValue: true, }, allowReadOnlyCheck: { type: 'switch', defaultValue: true, }, content: { type: 'text', hide: true, defaultValue: `

Welcome to Homarr's notebook widget

The notebook widget focuses on usability and is designed to be as simple as possible to bring a familiar editing experience to regular users, be it markdown or office type editors. It is based on Tiptap.dev and supports most of its features:

General text formatting

Bold

Italic

Underline

Strike-through

Text alignment

Headings

Lists

  1. Ordered

  • Bullet

  • Check

Coloring

Text coloring

highlighting

Table cells

Inserts

Links

Images

Tables


Widget options

`, }, }, gridstack: { minWidth: 2, minHeight: 1, maxWidth: 12, maxHeight: 12, }, component: NotebookWidget, }); export default definition; export type INotebookWidget = IWidget<(typeof definition)['id'], typeof definition>; interface NotebookWidgetProps { widget: INotebookWidget; } function NotebookWidget(props: NotebookWidgetProps) { return ; }