feat: editor improvements and architectural grid prototype
Multiple feature additions and improvements across the application: - NextGen Editor: drag handles, smart paste, block actions - Structured views: Kanban and table layouts for notes - Architectural Grid: new brainstorming/agent interface prototype - Flashcards: SM-2 revision algorithm with AI generation - MCP server: robustness improvements - Graph/PDF chat: fix click propagation and copy behavior - Various UI/UX enhancements and bug fixes Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
39
memento-note/lib/editor/smart-paste-extension.ts
Normal file
39
memento-note/lib/editor/smart-paste-extension.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
import { Extension } from '@tiptap/core'
|
||||
import type { EditorView } from '@tiptap/pm/view'
|
||||
import { Plugin, PluginKey } from '@tiptap/pm/state'
|
||||
|
||||
export type SmartPasteHandler = (view: EditorView, event: ClipboardEvent) => boolean
|
||||
|
||||
export const smartPastePluginKey = new PluginKey('smartPaste')
|
||||
|
||||
declare module '@tiptap/core' {
|
||||
interface Storage {
|
||||
smartPaste: {
|
||||
onPaste: SmartPasteHandler | null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export const SmartPasteExtension = Extension.create({
|
||||
name: 'smartPaste',
|
||||
|
||||
addStorage() {
|
||||
return {
|
||||
onPaste: null as SmartPasteHandler | null,
|
||||
}
|
||||
},
|
||||
|
||||
addProseMirrorPlugins() {
|
||||
const storage = this.storage
|
||||
return [
|
||||
new Plugin({
|
||||
key: smartPastePluginKey,
|
||||
props: {
|
||||
handlePaste(view, event) {
|
||||
return storage.onPaste?.(view, event) ?? false
|
||||
},
|
||||
},
|
||||
}),
|
||||
]
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user