Skip to content

Commit

Permalink
feat: update for content design
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Nov 21, 2023
1 parent 4cb048f commit d2d68ed
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 2b

2b is a editor for code generation.
> 2b is an editor for content generation, like blog, article, user story etc.
Todos

Expand All @@ -13,8 +13,9 @@ Todos
Diff [https://github.com/chenyuncai/tiptap-track-change-extension](https://github.com/chenyuncai/tiptap-track-change-extension)
- [ ] Customize prompt
- [ ] Variable: `$beforeCursor`, `$afterCursor`, `$selection`, `$similarChunk`, `$relatedChunk`
- [ ] Component code search
- Similar chunk in browser.
- [ ] Content search
- [ ] Similar chunk in browser.
- [ ] Code search
- [ ] DSL for units
- [ ] Backend
- [ ] Frontend
Expand All @@ -27,8 +28,8 @@ Todos

### Tiptap Editor extensions

[https://github.com/fantasticit/magic-editor](https://github.com/fantasticit/magic-editor)
[Think Editor'S Tiptap Plugins](https://github.com/fantasticit/think/tree/main/packages/client/src/tiptap/core/extensions)
- [https://github.com/fantasticit/magic-editor](https://github.com/fantasticit/magic-editor)
- [Think Editor's Tiptap extensions](https://github.com/fantasticit/think/tree/main/packages/client/src/tiptap/core/extensions)

## License

Expand Down
10 changes: 4 additions & 6 deletions components/editor/live-editor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import { MenuBar } from './menu-bar'

import MarkdownIt from 'markdown-it'
import { AiBubbleMenu } from './intelli/ai-bubble-menu'
import { createSlash, SlashCommands } from './slash-commands'
import { SlashMenuContainer } from './intelli/slash-menu-view'
import { createSlash } from './slash-commands'

const md = new MarkdownIt()
const CustomCommands = Extension.create({
Expand Down Expand Up @@ -51,8 +50,8 @@ const extensions = [
command: 'continue',
},
{
"title": '总结',
"command": 'summarize',
title: '总结',
command: 'summarize',
}
]
}),
Expand All @@ -67,11 +66,10 @@ const content = `
Hi there, BB is editor for Unit Mesh architecture paradigms, the next-gen software architecture.
1. use \`/\` to trigger AI commands.
2. use \`Alt\` + \`Enter\` to trigger the code gen.
2. use \`Alt\` + \`/\` or \`Option\` + \`/\` to trigger slash commands.
3. select text and right click to see the context menu.
`

const LiveEditor = () => {
const editor = useEditor({
extensions,
Expand Down
1 change: 0 additions & 1 deletion components/editor/slash-commands.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export const createSlash = (name, options) => {
editor: this.editor,
char: this.options.char,


command: ({ editor, props }) => {
const { state, dispatch } = editor.view
const { $head, $from } = state.selection
Expand Down
1 change: 1 addition & 0 deletions components/variables/varible-manage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//

0 comments on commit d2d68ed

Please sign in to comment.