mirror of
https://github.com/halo-dev/docs.git
synced 2025-10-22 10:58:56 +00:00
chore: bump docusaurus version to 3.x (#395)
升级 Docusaurus 版本至 3.x 参照 https://docusaurus.io/zh-CN/docs/migration/v3 升级指南。 Fixes #394 /kind improvement ```release-note None ```
This commit is contained in:
@@ -85,7 +85,7 @@ export default definePlugin({
|
||||
|
||||
## 实现案例
|
||||
|
||||
- <https://github.com/halo-dev/plugin-s3>
|
||||
- [https://github.com/halo-dev/plugin-s3](https://github.com/halo-dev/plugin-s3)
|
||||
|
||||
## 类型定义
|
||||
|
||||
|
@@ -143,4 +143,4 @@ const handleSelect = async (url: string) => {
|
||||
|
||||
## 实现案例
|
||||
|
||||
- <https://github.com/halo-sigs/plugin-unsplash>
|
||||
- [https://github.com/halo-sigs/plugin-unsplash](https://github.com/halo-sigs/plugin-unsplash)
|
||||
|
@@ -111,4 +111,4 @@ const stripHtmlTags = (str: string) => {
|
||||
|
||||
## 实现案例
|
||||
|
||||
- <https://github.com/halo-sigs/plugin-moments>
|
||||
- [https://github.com/halo-sigs/plugin-moments](https://github.com/halo-sigs/plugin-moments)
|
||||
|
@@ -18,7 +18,7 @@ export default definePlugin({
|
||||
```
|
||||
|
||||
:::info 提示
|
||||
AnyExtension 类型来自 [Tiptap](https://github.com/ueberdosis/tiptap),这意味着 Halo 默认编辑器的扩展点返回类型与 Tiptap 的扩展完全一致,Tiptap 的扩展文档可参考:<https://tiptap.dev/docs/editor/api/extensions>。此外,Halo 也为默认编辑器的扩展提供了一些独有的参数,用于实现工具栏、指令等扩展。
|
||||
AnyExtension 类型来自 [Tiptap](https://github.com/ueberdosis/tiptap),这意味着 Halo 默认编辑器的扩展点返回类型与 Tiptap 的扩展完全一致,Tiptap 的扩展文档可参考:[https://tiptap.dev/docs/editor/api/extensions](https://tiptap.dev/docs/editor/api/extensions)。此外,Halo 也为默认编辑器的扩展提供了一些独有的参数,用于实现工具栏、指令等扩展。
|
||||
:::
|
||||
|
||||
### Halo 独有扩展
|
||||
@@ -60,7 +60,7 @@ export interface ExtensionOptions {
|
||||
|
||||

|
||||
|
||||
在 <https://github.com/halo-sigs/richtext-editor/pull/16> 中,我们实现了对顶部工具栏的扩展,如果需要添加额外的功能,只需要在具体的 Tiptap Extension 中的 `addOptions` 中定义 `getToolbarItems` 函数即可,如:
|
||||
在 [https://github.com/halo-sigs/richtext-editor/pull/16](https://github.com/halo-sigs/richtext-editor/pull/16) 中,我们实现了对顶部工具栏的扩展,如果需要添加额外的功能,只需要在具体的 Tiptap Extension 中的 `addOptions` 中定义 `getToolbarItems` 函数即可,如:
|
||||
|
||||
```ts
|
||||
{
|
||||
@@ -130,7 +130,7 @@ addOptions() {
|
||||
|
||||

|
||||
|
||||
在 <https://github.com/halo-sigs/richtext-editor/pull/27> 中,我们实现了对编辑器工具箱区域的扩展,如果需要添加额外的功能,只需要在具体的 Tiptap Extension 中的 `addOptions` 中定义 `getToolboxItems` 函数即可,如:
|
||||
在 [https://github.com/halo-sigs/richtext-editor/pull/27](https://github.com/halo-sigs/richtext-editor/pull/27) 中,我们实现了对编辑器工具箱区域的扩展,如果需要添加额外的功能,只需要在具体的 Tiptap Extension 中的 `addOptions` 中定义 `getToolboxItems` 函数即可,如:
|
||||
|
||||
```ts
|
||||
{
|
||||
@@ -201,7 +201,7 @@ Slash Command (斜杠命令)的扩展,可用于在当前行快捷执行功
|
||||
|
||||

|
||||
|
||||
在 <https://github.com/halo-sigs/richtext-editor/pull/16> 中,我们实现了对 Slash Command 指令的扩展,如果需要添加额外的功能,只需要在具体的 Tiptap Extension 中的 `addOptions` 中定义 `getCommandMenuItems` 函数即可,如:
|
||||
在 [https://github.com/halo-sigs/richtext-editor/pull/16](https://github.com/halo-sigs/richtext-editor/pull/16) 中,我们实现了对 Slash Command 指令的扩展,如果需要添加额外的功能,只需要在具体的 Tiptap Extension 中的 `addOptions` 中定义 `getCommandMenuItems` 函数即可,如:
|
||||
|
||||
```ts
|
||||
{
|
||||
@@ -263,7 +263,7 @@ addOptions() {
|
||||
|
||||

|
||||
|
||||
在 <https://github.com/halo-sigs/richtext-editor/pull/38> 中,我们重构了对编辑器悬浮区域的扩展,如果需要对某个块进行支持,只需要在具体的 Tiptap Extension 中的 `addOptions` 中定义 `getBubbleMenu` 函数即可,如:
|
||||
在 [https://github.com/halo-sigs/richtext-editor/pull/38](https://github.com/halo-sigs/richtext-editor/pull/38) 中,我们重构了对编辑器悬浮区域的扩展,如果需要对某个块进行支持,只需要在具体的 Tiptap Extension 中的 `addOptions` 中定义 `getBubbleMenu` 函数即可,如:
|
||||
|
||||
```ts
|
||||
{
|
||||
@@ -296,7 +296,7 @@ interface BubbleMenuProps {
|
||||
from?: number;
|
||||
to?: number;
|
||||
}) => boolean;
|
||||
tippyOptions?: Record<string, unknown>; // 可自由定制悬浮菜单所用的 tippy 组件的选项
|
||||
tippyOptions?: Record\<string, unknown\>; // 可自由定制悬浮菜单所用的 tippy 组件的选项
|
||||
getRenderContainer?: (node: HTMLElement) => HTMLElement; // 悬浮菜单所基准的 DOM
|
||||
defaultAnimation?: boolean; // 是否启用默认动画。默认为 true
|
||||
}
|
||||
@@ -373,7 +373,7 @@ addOptions() {
|
||||
|
||||

|
||||
|
||||
在 <https://github.com/halo-sigs/richtext-editor/pull/48> 中,我们实现了对所有元素的拖拽功能,如果需要让当前扩展支持拖拽,只需要在具体的 Tiptap Extension 中的 `addOptions` 中定义 `getDraggable` 函数,并让其返回 true 即可。如:
|
||||
在 [https://github.com/halo-sigs/richtext-editor/pull/48](https://github.com/halo-sigs/richtext-editor/pull/48) 中,我们实现了对所有元素的拖拽功能,如果需要让当前扩展支持拖拽,只需要在具体的 Tiptap Extension 中的 `addOptions` 中定义 `getDraggable` 函数,并让其返回 true 即可。如:
|
||||
|
||||
```ts
|
||||
{
|
||||
@@ -474,6 +474,6 @@ addOptions() {
|
||||
|
||||
## 实现案例
|
||||
|
||||
- <https://github.com/halo-sigs/plugin-hybrid-edit-block>
|
||||
- <https://github.com/halo-sigs/plugin-katex>
|
||||
- <https://github.com/halo-sigs/plugin-text-diagram>
|
||||
- [https://github.com/halo-sigs/plugin-hybrid-edit-block](https://github.com/halo-sigs/plugin-hybrid-edit-block)
|
||||
- [https://github.com/halo-sigs/plugin-katex](https://github.com/halo-sigs/plugin-katex)
|
||||
- [https://github.com/halo-sigs/plugin-text-diagram](https://github.com/halo-sigs/plugin-text-diagram)
|
||||
|
@@ -179,10 +179,10 @@ code {
|
||||
</style>
|
||||
```
|
||||
|
||||
> 来源:<https://vuejs.org/examples/#markdown>
|
||||
> 来源:[https://vuejs.org/examples/#markdown](https://vuejs.org/examples/#markdown)
|
||||
|
||||
## 实现案例
|
||||
|
||||
- <https://github.com/halo-sigs/plugin-stackedit>
|
||||
- <https://github.com/halo-sigs/plugin-bytemd>
|
||||
- <https://github.com/justice2001/halo-plugin-vditor>
|
||||
- [https://github.com/halo-sigs/plugin-stackedit](https://github.com/halo-sigs/plugin-stackedit)
|
||||
- [https://github.com/halo-sigs/plugin-bytemd](https://github.com/halo-sigs/plugin-bytemd)
|
||||
- [https://github.com/justice2001/halo-plugin-vditor](https://github.com/justice2001/halo-plugin-vditor)
|
||||
|
@@ -2,7 +2,7 @@
|
||||
export interface OperationItem<T> {
|
||||
priority: number; // 排序优先级
|
||||
component: Raw<Component>; // 菜单项组件
|
||||
props?: Record<string, unknown>; // 菜单项组件属性
|
||||
props?: Record\<string, unknown\>; // 菜单项组件属性
|
||||
action?: (item?: T) => void; // 菜单项点击事件
|
||||
label?: string; // 菜单项标题
|
||||
hidden?: boolean; // 菜单项是否隐藏
|
||||
|
@@ -33,7 +33,7 @@ export interface PluginInstallationTab {
|
||||
id: string; // 选项卡 ID
|
||||
label: string; // 选项卡标题
|
||||
component: Raw<Component>; // 选项卡面板组件
|
||||
props?: Record<string, unknown>; // 选项卡面板组件属性
|
||||
props?: Record\<string, unknown\>; // 选项卡面板组件属性
|
||||
permissions?: string[]; // 选项卡 UI 权限
|
||||
priority: number; // 选项卡排序优先级
|
||||
}
|
||||
@@ -41,4 +41,4 @@ export interface PluginInstallationTab {
|
||||
|
||||
## 实现案例
|
||||
|
||||
- <https://github.com/halo-dev/plugin-app-store>
|
||||
- [https://github.com/halo-dev/plugin-app-store](https://github.com/halo-dev/plugin-app-store)
|
||||
|
@@ -33,7 +33,7 @@ export interface EntityFieldItem {
|
||||
priority: number;
|
||||
position: "start" | "end";
|
||||
component: Raw<Component>;
|
||||
props?: Record<string, unknown>;
|
||||
props?: Record\<string, unknown\>;
|
||||
permissions?: string[];
|
||||
hidden?: boolean;
|
||||
}
|
||||
@@ -71,7 +71,7 @@ export default definePlugin({
|
||||
|
||||
## 实现案例
|
||||
|
||||
- <https://github.com/halo-dev/plugin-app-store>
|
||||
- [https://github.com/halo-dev/plugin-app-store](https://github.com/halo-dev/plugin-app-store)
|
||||
|
||||
## 类型定义
|
||||
|
||||
|
@@ -42,7 +42,7 @@ import OperationItem from "./interface/OperationItem.md";
|
||||
|
||||
## 实现案例
|
||||
|
||||
- <https://github.com/halo-dev/plugin-app-store>
|
||||
- [https://github.com/halo-dev/plugin-app-store](https://github.com/halo-dev/plugin-app-store)
|
||||
|
||||
## 类型定义
|
||||
|
||||
|
@@ -37,7 +37,7 @@ export interface PluginTab {
|
||||
|
||||
其中,`component` 组件可以注入(inject)以下属性:
|
||||
|
||||
- `plugin`:当前插件对象,类型为 Ref<[Plugin](#plugin)>。
|
||||
- `plugin`:当前插件对象,类型为 Ref\<[Plugin](#plugin)\>。
|
||||
|
||||
## 示例
|
||||
|
||||
@@ -77,7 +77,7 @@ const plugin = inject<Ref<Plugin | undefined>>("plugin");
|
||||
|
||||
## 实现案例
|
||||
|
||||
- <https://github.com/halo-dev/plugin-app-store>
|
||||
- [https://github.com/halo-dev/plugin-app-store](https://github.com/halo-dev/plugin-app-store)
|
||||
|
||||
## 类型定义
|
||||
|
||||
|
@@ -33,7 +33,7 @@ export interface EntityFieldItem {
|
||||
priority: number;
|
||||
position: "start" | "end";
|
||||
component: Raw<Component>;
|
||||
props?: Record<string, unknown>;
|
||||
props?: Record\<string, unknown\>;
|
||||
permissions?: string[];
|
||||
hidden?: boolean;
|
||||
}
|
||||
|
@@ -78,7 +78,7 @@ export default definePlugin({
|
||||
|
||||
## 实现案例
|
||||
|
||||
- <https://github.com/halo-dev/plugin-app-store>
|
||||
- [https://github.com/halo-dev/plugin-app-store](https://github.com/halo-dev/plugin-app-store)
|
||||
|
||||
## 类型定义
|
||||
|
||||
|
@@ -33,7 +33,7 @@ export interface ThemeListTab {
|
||||
id: string; // 选项卡 ID
|
||||
label: string; // 选项卡标题
|
||||
component: Raw<Component>; // 选项卡面板组件
|
||||
props?: Record<string, unknown>; // 选项卡面板组件属性
|
||||
props?: Record\<string, unknown\>; // 选项卡面板组件属性
|
||||
permissions?: string[]; // 选项卡 UI 权限
|
||||
priority: number; // 选项卡排序优先级
|
||||
}
|
||||
@@ -41,4 +41,4 @@ export interface ThemeListTab {
|
||||
|
||||
## 实现案例
|
||||
|
||||
- <https://github.com/halo-dev/plugin-app-store>
|
||||
- [https://github.com/halo-dev/plugin-app-store](https://github.com/halo-dev/plugin-app-store)
|
||||
|
Reference in New Issue
Block a user