-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: make default editor extensible (#4090)
#### What type of PR is this? /area console /kind feature /milestone 2.7.x #### What this PR does / why we need it: 默认编辑器支持扩展,包括输入类型、工具栏、Slash Command 等。 Ref halo-sigs/richtext-editor#16 ## 定义方式 ```ts import ExtensionFoo from "./tiptap/extension-foo.ts" export default definePlugin({ extensionPoints: { "default:editor:extension:create": () => { return [ExtensionFoo]; }, }, }); ``` 其中,`ExtensionFoo` 是一个 Tiptap Extension,可以参考 [Tiptap 文档](https://tiptap.dev/) 和 [https://github.com/halo-sigs/richtext-editor/blob/main/docs/extension.md](https://github.com/halo-sigs/richtext-editor/blob/main/docs/extension.md)。 #### Which issue(s) this PR fixes: Fixes #4028 #### Does this PR introduce a user-facing change? ```release-note Console 端的默认编辑器支持被扩展 ```
- Loading branch information
Showing
5 changed files
with
496 additions
and
549 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# 默认编辑器扩展点 | ||
|
||
该扩展点用于扩展默认编辑器的功能,包括 Tiptap Extension,以及工具栏、悬浮工具栏、Slash Command。 | ||
|
||
## 定义方式 | ||
|
||
```ts | ||
import ExtensionFoo from "./tiptap/extension-foo.ts" | ||
|
||
export default definePlugin({ | ||
extensionPoints: { | ||
"default:editor:extension:create": () => { | ||
return [ExtensionFoo]; | ||
}, | ||
}, | ||
}); | ||
``` | ||
|
||
其中,`ExtensionFoo` 是一个 Tiptap Extension,可以参考 [Tiptap 文档](https://tiptap.dev/) 和 [https://github.com/halo-sigs/richtext-editor/blob/main/docs/extension.md](https://github.com/halo-sigs/richtext-editor/blob/main/docs/extension.md)。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.