mirror of
https://github.com/Mail-0/Zero.git
synced 2026-03-03 02:27:00 +00:00
Ran oxc (https://oxc.rs/docs/guide/usage/linter.html#vscode-extension) and fixed all the issues that came up, set it up to run as a PR check and added steps to the README.md asking users to use it. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Introduced JavaScript linting using oxlint in development guidelines and CI workflow for improved code quality. * Added oxlint configuration and dependencies to the project. * **Bug Fixes** * Improved error logging in various components and utilities for better debugging. * Enhanced React list rendering by updating keys to use unique values instead of array indices, reducing rendering issues. * Replaced browser alerts with toast notifications for a smoother user experience. * **Refactor** * Simplified component logic and state management by removing unused code, imports, props, and components across multiple files. * Updated function and component signatures for clarity and maintainability. * Improved efficiency of certain operations by switching from arrays to sets for membership checks. * **Chores** * Cleaned up and reorganized import statements throughout the codebase. * Removed deprecated files, components, and middleware to streamline the codebase. * **Documentation** * Updated contribution guidelines to include linting requirements for code submissions. * **Style** * Minor formatting and readability improvements in JSX and code structure. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
68 lines
1.9 KiB
TypeScript
68 lines
1.9 KiB
TypeScript
import {
|
|
Heading1,
|
|
Heading2,
|
|
Heading3,
|
|
List,
|
|
ListOrdered,
|
|
Text,
|
|
} from 'lucide-react';
|
|
import { createSuggestionItems } from 'novel';
|
|
|
|
export const suggestionItems = createSuggestionItems([
|
|
{
|
|
title: 'Text',
|
|
description: 'Just start typing with plain text.',
|
|
searchTerms: ['p', 'paragraph'],
|
|
icon: <Text size={18} />,
|
|
command: ({ editor, range }) => {
|
|
editor.chain().focus().deleteRange(range).toggleNode('paragraph', 'paragraph').run();
|
|
},
|
|
},
|
|
|
|
{
|
|
title: 'Heading 1',
|
|
description: 'Big section heading.',
|
|
searchTerms: ['title', 'big', 'large'],
|
|
icon: <Heading1 size={18} />,
|
|
command: ({ editor, range }) => {
|
|
editor.chain().focus().deleteRange(range).setNode('heading', { level: 1 }).run();
|
|
},
|
|
},
|
|
{
|
|
title: 'Heading 2',
|
|
description: 'Medium section heading.',
|
|
searchTerms: ['subtitle', 'medium'],
|
|
icon: <Heading2 size={18} />,
|
|
command: ({ editor, range }) => {
|
|
editor.chain().focus().deleteRange(range).setNode('heading', { level: 2 }).run();
|
|
},
|
|
},
|
|
{
|
|
title: 'Heading 3',
|
|
description: 'Small section heading.',
|
|
searchTerms: ['subtitle', 'small'],
|
|
icon: <Heading3 size={18} />,
|
|
command: ({ editor, range }) => {
|
|
editor.chain().focus().deleteRange(range).setNode('heading', { level: 3 }).run();
|
|
},
|
|
},
|
|
{
|
|
title: 'Bullet List',
|
|
description: 'Create a simple bullet list.',
|
|
searchTerms: ['unordered', 'point'],
|
|
icon: <List size={18} />,
|
|
command: ({ editor, range }) => {
|
|
editor.chain().focus().deleteRange(range).toggleBulletList().run();
|
|
},
|
|
},
|
|
{
|
|
title: 'Numbered List',
|
|
description: 'Create a list with numbering.',
|
|
searchTerms: ['ordered'],
|
|
icon: <ListOrdered size={18} />,
|
|
command: ({ editor, range }) => {
|
|
editor.chain().focus().deleteRange(range).toggleOrderedList().run();
|
|
},
|
|
},
|
|
]);
|