Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ GitHub Actions Release Workflow ([English](docs/release/github-release.en.md), [
Development Conditions ([English](docs/meta/Copilot.md))

For more details, check the documentation in the [docs](docs/) folder.
- The [Notion Editor](docs/notion-editor.md) template demonstrates a Notion-style layout with a basic AI extension.
2 changes: 2 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Welcome to the documentation for the macOS editor. Below is a summary of the ava
- [Build Script](build-script.md)
- [Package.json File](package-json.md)
- [Splash Screen Functionality](splash-screen.md)
- [Notion Editor](notion-editor.md)

## Documentation Structure

Expand All @@ -21,4 +22,5 @@ graph TD;
A --> F[Build Script];
A --> G[Package.json File];
A --> H[Splash Screen Functionality];
A --> I[Notion Editor];
```
3 changes: 3 additions & 0 deletions docs/notion-editor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Notion Editor

The Notion Editor uses the same toolbar from the Simple Editor but applies a Notion-style layout. It also loads a placeholder AI extension called `Agent` that demonstrates how to insert generated text with a custom command.
18 changes: 18 additions & 0 deletions src/components/tiptap-extension/agent-extension.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { Extension } from "@tiptap/react"

export const Agent = Extension.create({
name: "agent",
addCommands() {
return {
generate:
(prompt: string) =>
async ({ commands }) => {
const aiText = `AI: ${prompt}`
commands.insertContent(aiText)
return true
},
}
},
})

export default Agent
Loading