Skip to content

Commit

Permalink
feat: add customize prompt for items
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Nov 21, 2023
1 parent 9b28778 commit 4cb048f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Todos
like: [https://codesandbox.io/s/prosemirror-diff-nuhiiq](https://codesandbox.io/s/prosemirror-diff-nuhiiq)
- Change
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.
- [ ] DSL for units
Expand Down
2 changes: 2 additions & 0 deletions components/editor/diff/diff.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// diff format

4 changes: 4 additions & 0 deletions components/editor/live-editor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ const md = new MarkdownIt()
const CustomCommands = Extension.create({
addCommands: () => {
return {
// for examples: $selection, $beforeCursor
variable: (variableName, variableValue) => ({ tr, commands }) => {
console.log('variable', variableName, variableValue)
},
getSelectedText: () => ({ editor }) => {
const { from, to, empty } = editor.state.selection

Expand Down

0 comments on commit 4cb048f

Please sign in to comment.