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:
2026-07-06 14:13:27 +08:00
parent 91c93954df
commit aac51bf183
72 changed files with 5790 additions and 203 deletions
+27
View File
@@ -0,0 +1,27 @@
import { Mark, mergeAttributes } from '@tiptap/core'
export const LandmarkMark = Mark.create({
name: 'landmark',
inclusive: true,
addAttributes() {
return {
label: { default: '' },
landmarkType: { default: 'todo' }
}
},
parseHTML() {
return [{ tag: 'span[data-landmark]' }]
},
renderHTML({ HTMLAttributes }) {
const label = HTMLAttributes.label ?? ''
return [
'span',
mergeAttributes(HTMLAttributes, {
'data-landmark': 'true',
class: 'landmark-mark',
'data-testid': 'landmark-mark'
}),
`[TODO: ${label}]`
]
}
})
+27
View File
@@ -0,0 +1,27 @@
import { Mark, mergeAttributes } from '@tiptap/core'
export const SettingMention = Mark.create({
name: 'settingMention',
inclusive: false,
addAttributes() {
return {
id: { default: null },
label: { default: null }
}
},
parseHTML() {
return [{ tag: 'span[data-setting-mention]' }]
},
renderHTML({ HTMLAttributes }) {
const label = HTMLAttributes.label ?? ''
return [
'span',
mergeAttributes(HTMLAttributes, {
'data-setting-mention': 'true',
class: 'setting-mention',
'data-testid': 'setting-mention'
}),
`@${label}`
]
}
})