feat: Notion-like rich text editor with TipTap, 4 note types, slash commands & bubble menu
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 1m33s
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 1m33s
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
import { revalidatePath } from 'next/cache'
|
||||
import prisma from '@/lib/prisma'
|
||||
import { Note, CheckItem } from '@/lib/types'
|
||||
import { Note, CheckItem, NoteType } from '@/lib/types'
|
||||
import { auth } from '@/auth'
|
||||
import { getAIProvider } from '@/lib/ai/factory'
|
||||
import { parseNote as parseNoteUtil, cosineSimilarity, calculateRRFK, detectQueryType, getSearchWeights } from '@/lib/utils'
|
||||
@@ -626,7 +626,7 @@ export async function createNote(data: {
|
||||
title?: string
|
||||
content: string
|
||||
color?: string
|
||||
type?: 'text' | 'checklist'
|
||||
type?: NoteType
|
||||
checkItems?: CheckItem[]
|
||||
labels?: string[]
|
||||
images?: string[]
|
||||
@@ -637,8 +637,8 @@ export async function createNote(data: {
|
||||
size?: 'small' | 'medium' | 'large'
|
||||
autoGenerated?: boolean
|
||||
aiProvider?: string
|
||||
notebookId?: string | undefined // Assign note to a notebook if provided
|
||||
skipRevalidation?: boolean // Option to prevent full page refresh for smooth optimistic UI updates
|
||||
notebookId?: string | undefined
|
||||
skipRevalidation?: boolean
|
||||
}) {
|
||||
const session = await auth();
|
||||
if (!session?.user?.id) throw new Error('Unauthorized');
|
||||
@@ -659,7 +659,7 @@ export async function createNote(data: {
|
||||
title: data.title || null,
|
||||
content: data.content,
|
||||
color: data.color || 'default',
|
||||
type: data.type || 'text',
|
||||
type: data.type || 'richtext',
|
||||
checkItems: data.checkItems ? JSON.stringify(data.checkItems) : null,
|
||||
labels: null, // set by syncNoteLabels below
|
||||
images: data.images ? JSON.stringify(data.images) : null,
|
||||
@@ -799,7 +799,7 @@ export async function updateNote(id: string, data: {
|
||||
color?: string
|
||||
isPinned?: boolean
|
||||
isArchived?: boolean
|
||||
type?: 'text' | 'checklist'
|
||||
type?: NoteType
|
||||
checkItems?: CheckItem[] | null
|
||||
labels?: string[] | null
|
||||
images?: string[] | null
|
||||
|
||||
Reference in New Issue
Block a user