feat: deliver P2 v0.2.0 with unified editor, search, and snapshots
Implement schema v2 migration, outline/setting/inspiration CRUD, unified TipTap editing, reference panel with mentions, FTS global search, chapter version history, writing landmarks, word frequency analysis, light theme contrast fixes, and full unit/E2E test coverage. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
import { create } from 'zustand'
|
||||
|
||||
type ReferenceTab = 'setting' | 'outline' | 'inspiration'
|
||||
|
||||
interface ReferenceState {
|
||||
open: boolean
|
||||
tab: ReferenceTab
|
||||
query: string
|
||||
pinnedIds: string[]
|
||||
setOpen: (open: boolean) => void
|
||||
setTab: (tab: ReferenceTab) => void
|
||||
setQuery: (query: string) => void
|
||||
togglePin: (id: string) => void
|
||||
}
|
||||
|
||||
export const useReferenceStore = create<ReferenceState>((set, get) => ({
|
||||
open: false,
|
||||
tab: 'setting',
|
||||
query: '',
|
||||
pinnedIds: [],
|
||||
setOpen: (open) => set({ open }),
|
||||
setTab: (tab) => set({ tab }),
|
||||
setQuery: (query) => set({ query }),
|
||||
togglePin: (id) => {
|
||||
const pinned = get().pinnedIds
|
||||
set({
|
||||
pinnedIds: pinned.includes(id) ? pinned.filter((x) => x !== id) : [...pinned, id]
|
||||
})
|
||||
}
|
||||
}))
|
||||
Reference in New Issue
Block a user